Dec 10, 2002 #1 simran1 Programmer Apr 23, 2002 82 US Hi, I have this Query SQl = "Select * from IncidentReport Where ITime = '8:58:00 AM'" And i have a record to match the comparison. But i still get the record count to be Zero. How do i do time comparisons?
Hi, I have this Query SQl = "Select * from IncidentReport Where ITime = '8:58:00 AM'" And i have a record to match the comparison. But i still get the record count to be Zero. How do i do time comparisons?
Dec 10, 2002 #2 JayKusch MIS Oct 30, 2001 3,199 US Try ... Select * from IncidentReport Where Convert(Char(12), ITime,108) = '8:58:00 AM' Thanks J. Kusch Upvote 0 Downvote
Try ... Select * from IncidentReport Where Convert(Char(12), ITime,108) = '8:58:00 AM' Thanks J. Kusch
Dec 10, 2002 Thread starter #3 simran1 Programmer Apr 23, 2002 82 US Hi, Am sorry, but i still get my record count to be zero. Upvote 0 Downvote
Dec 10, 2002 #4 SQLBill MIS May 29, 2001 7,777 US Do you have to query using the AM/PM time format? Can you use the 24 hour format? Using 108 with CONVERT returns the time as hh:mm:ss (24 hour format). If you can use that format, try this: Select * from IncidentReport Where Convert(Char(12), ITime,108) = '08:58:00' -SQLBill Upvote 0 Downvote
Do you have to query using the AM/PM time format? Can you use the 24 hour format? Using 108 with CONVERT returns the time as hh:mm:ss (24 hour format). If you can use that format, try this: Select * from IncidentReport Where Convert(Char(12), ITime,108) = '08:58:00' -SQLBill