By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,760 Members | 1,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,760 IT Pros & Developers. It's quick & easy.

query to find month in date/time field

P: 1
If I have a field in my Access 2000 database that is a date/time type and it contains dates like 01/01/25 and 06/01/52, 06/14/85 and 02/17/78 and I want to pull out only the dates that are in June.

Do you have a simple SQL statement that can do that?

I have tried using datePart but it doesn't like my syntax. I tried WHERE (((NewPatDataNew.DOB_Pat)=DatePart("06","dob_pat") )) and it tells me invalid procedure call. you know how helpful the errors are.

Maybe if I used BETWEEN?

thank you in advance....pulling out hairs now
May 31 '07 #1
Share this Question
Share on Google+
1 Reply

Rabbit
Expert Mod 10K+
P: 12,441
If I have a field in my Access 2000 database that is a date/time type and it contains dates like 01/01/25 and 06/01/52, 06/14/85 and 02/17/78 and I want to pull out only the dates that are in June.

Do you have a simple SQL statement that can do that?

I have tried using datePart but it doesn't like my syntax. I tried WHERE (((NewPatDataNew.DOB_Pat)=DatePart("06","dob_pat") )) and it tells me invalid procedure call. you know how helpful the errors are.

Maybe if I used BETWEEN?

thank you in advance....pulling out hairs now
WHERE Month(DOB_Pat) = 6
May 31 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.