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

Use DateAdd in a query

Status
Not open for further replies.

tekspaz

Programmer
Aug 28, 2001
1
US
I am developing a report that is creating columns for 'Units_Sold' based on dates. I have already created a system object that queries the database and stores the max date found in the appropriate table. Now, I would like to query the data again and only pull the 'Units_Sold' for the week prior to the Current date.

I have created another query and am selecting 'Units_Sold' where 'Week_Ending' = Dateadd("d",-7,'Current_Week').

This doesn't seem to work. Any suggestions?
 
You should have mention what database you are using...
Ok I will give an example for MS-Access database.

Create a condiion in the universe, and write
"Format(Sales.invoice_date,'WW') = Format(date()-7,'WW')"
in the where clause.

and add this condition in the report's dataprovider condition window...this will give you the data for last week

Shyam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top