I havent used the all the parts of the data you posted.But the below query will give you an general idea.declare @tblReturns as table(dates date,store varchar(20),totals varchar(2))insert into @tblReturnsselect '1/1/2010','Store1','34'union allselect'1/1/2010','Store2','23'union allselect'1/2/2010','Store1','15'union allselect'1/2/2010','Store2','34'union allselect'1/3/2010','Store1','43'union allselect'1/3/2010','Store2','24'union allselect'1/4/2010','Store1','45'union allselect'1/4/2010','Store2','34'union allselect'1/5/2010','Store1','26'union allselect'1/5/2010','Store2','27'union allselect'1/6/2010','Store1','34'union allselect'1/6/2010','Store2','44'union allselect'1/7/2010','Store1','23'union allselect'1/7/2010','Store2','56'union allselect'1/8/2010','Store1','45'union allselect'1/8/2010','Store2','33'union allselect'1/9/2010','Store1','31'union allselect'1/9/2010','Store2','54'union allselect'1/10/2010','Store1','43'union allselect'1/10/2010','Store2','42'union allselect'1/11/2010','Store1','25'union allselect'1/11/2010','Store2','43'union allselect'1/12/2010','Store1','27'union allselect'1/12/2010','Store2','51'union allselect'1/13/2010','Store1','43'select * from @tblReturnsselect 'WeekNo' + '' + convert(varchar,datepart(week,dates))as week,store,SUM(convert(int,totals))Ordersfrom @tblReturnsgroup by datepart(week,dates),store
Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless. PBUH