current month

R

rml

What would be the proper syntax for a query to return the
records for the current month? I would like it to work
like date() but for the month.

Thanks.
 
J

Jeff Boyce

Would it be safe to assume that you do not want to find all records for July
(any year), but only for July, this year?

If so, consider using the DateSerial () function, in something like:

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

This takes advantage of the fact that the "zeroth" day of the next month
(Month(Date())+1) is the last day of this month.
 

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