I'm using this code to place Time\Date stamps in specific Access Columns:
Dim conn,strsql,sql_update,ssn,cps,hdDate,TOD,PageDate,h
h=hour(now())
ssn = "Select SSN From CWCT07 where SSN = '" & Request.Form("SSN") & "'"
If _
(Request.form("PageDate")) = "1/30/2007" And "h" < "12" _
Then _
sql_update = "Update CWCT07 Set Jan30AM = '" & Request.Form("hdDate") & "' where ssn = '" & Request.form("ssn") & "'" _
Else If _
(Request.form("PageDate")) = "1/30/2007" And "h" > "12" _
Then _
sql_update = "Update CWCT07 Set Jan30PM = '" & Request.Form("hdDate") & "' where ssn = '" & Request.form("ssn") & "'" _
Else If _
(Request.form("PageDate")) = "2/05/2007" And "h" < "12" _
Then _
sql_update = "Update CWCT07 Set Feb02AM = '" & Request.Form("hdDate") & "' where ssn = '" & Request.form("ssn") & "'" _
Else _
response.write(DATE()) _
End If
I get the correct answer:
1/30/2007 7:49:19 AM
But it is going into the Jan30PM column, not the Jan30AM Column. Shouldn't it be reading 7 as less than 12? Is there anyway to parse for the AM/PM part of the Date Function??
Thanks