From: doug on
Looking for some advice on a sql report. I need to summarize data in weekly
time "buckets". The week is defined as Sun thru Sat. The report rundate and
anthing prior should be week 0, with the future weeks numbered 1, 2, 3, etc.
At some point there may be a requirement to group all dates after a future
date into one bucket (ie. "9+ weeks"). Any suggestions on how to accomplish
numbering the weeks?

Thanks in advance.
From: Patrice on
Hello,

> Any suggestions on how to accomplish
> numbering the weeks?

Are you looking for http://msdn.microsoft.com/en-us/library/ms181765.aspx
(CASE) or http://msdn.microsoft.com/en-us/library/ms189794.aspx (DATEDIFF) ?
Also the list of weeks could be produced friom existing data or is sometimes
created using a function (allows easily to force showing a week even if no
data are available for this particular week).

You may want to be more explicit about the problem (is this to test in which
week you are or a more general problem ?).

--
Patrice