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!

Rolling 4 Weeks Total

Status
Not open for further replies.
Mar 20, 2009
102
US
I am working on a report that I would like to capture totals going back 4 weeks?

For instance, I can easily capture this week's total because I can write something like this:

sum(isnull(e.AllTCHours, 0))
where weekending = '2009-8-29'...

How can I get a sum going back for the entire month of August which woud capture weekend '2009-8-22', '2009-8-15' etc... without having to hardcode it in.

Thanks for all help!!!!
 
DateAdd function allows to use week as a parameter. See BOL for details.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top