Date - Current Month

JohnLee

Registered User.
Local time
Today, 07:54
Joined
Mar 8, 2007
Messages
692
Hi,

I hoping someone can assist me here, I've looked through the forum for other date related threads raised, but none seem to assist me with what I need to achieve.

I have created a query with an appropriate date field, and I am can't seem to work out how to write the correct formulae to get the query to only show data with a date range for the current month only.

I don't want the user to be prompted to enter any information, I want the query to automatically always, when in the current month only show data for the current month.

Any assistance would be most appreciated.

John
 
Month(Date()) Will return the current month. Not sure what you want.

Chris B
 
Hi -

Try this in your datefield's criteria (I'm assuming this is in proper datetime data format and not text):
Code:
Between DateSerial(Year(Date()),Month(Date()),1) And DateSerial(Year(Date()),Month(Date())+1,0)
Should return only records in the current month.

HTH - Bob
 
Hi Bob,

Thanks for that, just exactly what I needed, wasn't aware of the Month Function.

FAB

John
 
Hi John-

Glad that it worked for you. Note that this works for any month, regardless of length.

Bob
 

Users who are viewing this thread

Back
Top Bottom