MrSiezen
Dec 5 2005, 04:08 AM
Why is this comparison true at 10 AM?
ow() > #12:30:00 PM#
Larry Larsen
Dec 5 2005, 04:13 AM
Hi
Try:
TimeValue(Now()) > #12:30:00 PM#
Result:
False
truittb
Dec 5 2005, 07:47 AM
To explain why it is that way you need to understand that Access uses a default value for every date/time datatype. If you do not supply either the date or the time Access uses 0 for the missing portion. In your case the date is Dec 30, 1899.
Try this in the iommediate window, it converts the time value to a datetime and then returns the year.
? year(cdate(#12:30:00 PM#))
1899
You could also use the Time() function
? Time() > #12:30:00 PM#
False