Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access/SQL query by current month 1

Status
Not open for further replies.

bicit

MIS
Jul 14, 2004
11
US
Hello all,
Fairly basic question, I'm sure..I am trying to create a SQL based query to return all records from the start of the current month only. This criteria below works great for returning a rolling 30 days....

>=(DateAdd("m",-1,Date()))

...but I always want it fixed from the start of the current month..for example, running the query today grabs stuff from Sept 7th on.
Any ideas?
Thanks.
------------------
 
So you want only records with a date that is greater than or = to the current month?

Instead of the date add, try

>=datevalue(format(date(), "MM-01-YYYY"))

ChaZ

"When religion and politics ride in the same cart...the whirlwind follows."
Frank Herbert
 
You are welcome. And may the force be with you.

ChaZ

"When religion and politics ride in the same cart...the whirlwind follows."
Frank Herbert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top