Date/Time Criteria- Simple, Right???

shuff

Registered User.
Local time
Today, 21:45
Joined
Oct 13, 2000
Messages
61
OK... what am I forgetting?

I have a linked SQL table with a Date/Time field called DATE. ALL I WANT TO DO is pluck all the records with a single date from that table.

Predictibly, the date field has values like this:
9/11/2006 12:40:46 PM

If in the MS-Access query I use criteria of #9/11/2006# I get other dates also. I have tried variations on Date() or DatePart but those either fail or don't work. Sheesh.

ULTIMATELY, I want to restrict records to a specific date, and then a certain hour of that date, so if you can include this bit of additional logic in your response, that'd be great too. Note: I am trying to structure a query, not write code.

Thanks!
 
Don't name your Date Field Date as it is a reserved word, thats probably not your problem but it can cause you difficulty.

use the expressions below to break you date apart and then Restrict them individually

Year([YourDateField])
Month([YourDateField])
Day([YourDateField])
Hour([YourDateField])
TimeValue([YourDateField])
 

Users who are viewing this thread

Back
Top Bottom