%@ LANGUAGE="VBScript" %> <% dtToday = Date() frmDate = Request.Form("CURDATE") if Request("view_date") <> "" then frmDate= DateSerial(year(Request("view_date")), month(Request("view_date")), 1) end if function dNum(n) if n >= 10 then dNum = cstr(n) Else dNum = "0" & cstr(n) End If End Function 'SQL Formatted Date Function SQLDateDisplay(dt) SQLDateDisplay = Year(dt) & "-" & DNum(Month(dt)) & "-" & Dnum(Day(dt)) '& " " & dnum(hour(dt)) & ":" & dnum(Minute(dt)) End Function Function SQLDate(dt) SQLDate = cdbl(dt) End Function Function DtPrevSunday(ByVal dt) Do While WeekDay(dt) > vbSunday dt = DateAdd("d", -1, dt) Loop DtPrevSunday = dt End Function If InStr(1, Request.Form, "subPrev", 1) > 0 Then dtCurViewMonth = DateAdd("m", -1, frmDate) ElseIf InStr(1, Request.Form, "subNext", 1) > 0 Then dtCurViewMonth = DateAdd("m", 1, frmDate) Else if Request("view_date") <> "" then dtCurviewMonth = frmDate else dtCurViewMonth = DateSerial(Year(dtToday), Month(dtToday), 1) End If End If %>