callstate
asked on
SQL query to pull today's transactions
I have an access database that logs history using the =Now() function into a field called TimeStamp. I'd like a simple query to pull all records with a certain date, but since each record also has a time attached, all my results return blank.
I'm thinking ...
SELECT * from tblHistory WHERE TimeStamp = "02/07/13"
But the recordset returns empty because the underlying data is ...
TimeStamp
02/07/2013 3:58:01 PM
02/07/2013 3:58:15 PM
02/07/2013 3:58:55 PM
02/07/2013 3:59:01 PM
02/07/2013 3:56:30 PM
HELP?!
I'm thinking ...
SELECT * from tblHistory WHERE TimeStamp = "02/07/13"
But the recordset returns empty because the underlying data is ...
TimeStamp
02/07/2013 3:58:01 PM
02/07/2013 3:58:15 PM
02/07/2013 3:58:55 PM
02/07/2013 3:59:01 PM
02/07/2013 3:56:30 PM
HELP?!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect!
BTW,
I would get out of the habit of calling it a [TimeStamp] as that has a very specific meaning in SQL Server. I use [LastModified]
I would get out of the habit of calling it a [TimeStamp] as that has a very specific meaning in SQL Server. I use [LastModified]
select * from tblhistory where convert(varchar, timestamp, 101) = "02/07/13"
EDIT:
I failed to see that you're in access, so you might have to try this:
select * from tblhistory
WHERE timestamp >= #2013-02-07# and Licenses.Entereddate < #2013-02-08#