Date/Time Criteria

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field in table with the data type date/time.
In a query, I want to get all the records that were done on say, 1/15/2006,
without regard to the time they were done.
How do I set the criteria? #1/15/2006# doesn't work because I'm not allowing
for the time component, I guess.
Thanks,
 
Howard said:
I have a field in table with the data type date/time.
In a query, I want to get all the records that were done on say, 1/15/2006,
without regard to the time they were done.
How do I set the criteria? #1/15/2006# doesn't work because I'm not allowing
for the time component, I guess.

SELECT *
FROM TableName
WHERE DateField >= #1/15/2006#
AND DateField < #1/16/2006#
 
I have a field in table with the data type date/time.
In a query, I want to get all the records that were done on say, 1/15/2006,
without regard to the time they were done.
How do I set the criteria? #1/15/2006# doesn't work because I'm not allowing
for the time component, I guess.
Thanks,

Try a criterion
= CDate([Enter search date:]) AND < DateAdd("d", 1, CDate([Enter search date:]))

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top