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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query with date criteria for this month only

Status
Not open for further replies.

Ymesei

MIS
Jul 25, 2000
44
GU
Is there any way to create a query that automatically sets the criteria for a date field to only include date within the current month?
 
You can do this type of query:<br><br>SELECT Workorders.WorkorderID, Workorders.DateReceived<br>FROM Workorders<br>WHERE (((Format([DateReceived],&quot;myyyy&quot;))=Month(Date()) & Year(Date())));<br><br>HTH,<br>Drew
 
Duh on my part...I guess it's reasonable to assume this would work fine too for the where clause...<br><br>WHERE (((Format([DateReceived],&quot;mmyyyy&quot;))=Format(Date(),&quot;mmyyyy&quot;)));<br><br>D<br><br>
 
Thanks DreewToo.&nbsp;&nbsp;It worked like a charm.&nbsp;&nbsp;I appreciate it much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top