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

Query Expressions

Status
Not open for further replies.

damaruk

Technical User
Aug 2, 2000
53
GB
I want to create a expression in a query that will look at todays date and everything else in the previus 7 days. I dont want to use the ie) BETWEEN 14/09/00 AND 21/09/00 as I want to attached a report to this query that can run automatically from the Switchboard. I have everything set up other than the expression required in the query field. Ie =DATE() - 7 days but I dont know how to put it in an expression.

Thanks
Mark [sig][/sig]
 
Have you tried using 'WHERE [Datefield] >= (Date()-7)'

Hope this helps... [sig]<p>Phooey<br><a href=mailto:Andrew.j.harrison@capgemini.co.uk>Andrew.j.harrison@capgemini.co.uk</a><br>Otherwise known as Windy Bottom.[/sig]
 
I think there is a DateAdd function you can use.
DateAdd(type, interval, date)
you would do:

Dateadd('d', -7, Date())

The 'd' tells it to manipulate the days.

Evie [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top