I have a little trouble when working with date and/or times in queries and need some help with the following query:
I have two fields FirstDetect and LastDetect) in a table which are date/time types formatted in like so "5/11/2004 4:54:02 PM". I need to run a query which will select the records where the LastDetect field is a time/date earlier than FirstDetect field. Like:
SELECT Location, TagCode, FirstDetect, LastDetect
FROM MasterData
WHERE LastDetect < FirstDetect
So if FirstDetect had a value of 5/19/2004 3:45:58 PM and LastDetect had a value of 5/19/2004 1:15:48 PM, that record would be selected.
Any suggestions on how to go about doing this?
Thanks for your help.
I have two fields FirstDetect and LastDetect) in a table which are date/time types formatted in like so "5/11/2004 4:54:02 PM". I need to run a query which will select the records where the LastDetect field is a time/date earlier than FirstDetect field. Like:
SELECT Location, TagCode, FirstDetect, LastDetect
FROM MasterData
WHERE LastDetect < FirstDetect
So if FirstDetect had a value of 5/19/2004 3:45:58 PM and LastDetect had a value of 5/19/2004 1:15:48 PM, that record would be selected.
Any suggestions on how to go about doing this?
Thanks for your help.