I’m trying to select all records where DateTimeEntered is within roughly 4 hours of variable MyDateTime. Any ideas how to do this? Here’s what I was trying and it doesn’t work for some obvious reasons. Apparently casting to double is not an option. Also, I’m only checking to see if the value of MyDateTime is less by less than .1 but I also need to check to see if it’s greater but not greater than .1. I’m guessing there is a better way of doing this. Any ideas?
"SELECT ID from visit " & _
"WHERE (Cast(datetimeentered AS Double) - " & CDbl(MyDateTime) & ") < .1"
The VBA in your Classic ASP may turn out to be something like
That will basically do this (with the value of MyDateTime)