query for records this month

S

Spencer Hutton

i am an access newbie. i need help with a function in a query. i want to
create a function that will return only the records created this month. the
date field is called 'StartDate'. so i want only records whose 'StartDate'
value falls in the current month. TIA.
 
W

Wayne Morgan

For the criteria in the StartDate field try:

Between DateSerial(Year(Date()), Month(Date()), 1) And
DateSerial(Year(Date()), Month(Date()) + 1, 0)

The 0 in the second part is really 1 - 1. What we are doing is finding the
first day of next month (Month + 1) and subtracting 1 day.
 

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

Top