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

query only current day and current day in the past 1

Status
Not open for further replies.

itechC

Programmer
Feb 13, 2003
71
CA
hello,

I would like to create a query that will give me results for current day (example may 7) and also every 7 th of the month previous. Much appreciated.

Frank
 
SQL code snippet (WHERE clause):
Code:
WHERE [your date field] IN (Date(),DateSerial(Year(Date()),Month(Date())-1,Day(Date())))
Another way:
Code:
WHERE [your date field] IN (Date(),DateAdd('m',-1,Date())

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
OOps, you said every:
Code:
WHERE Day([your date field])=Day(Date()) AND [your date field]<=Date()

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top