NowDate = Date ()
NowDatez = split (nowdate, "-")
nowdatey = nowdatez (0)
NowDatem = nowDatez (1) -1
DateFinal = cstr (nowDatey) "-" CSTR (nowDatem)
Date2 = CSTR (RS ("Year")) "-" CSTR (RS ("Month"))
Cha = Datediff ("D", Formator (DateFinal), Formator (Date2) * 1
ASP function