Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Group By problem

Author  Topic 

raydenl
Starting Member

16 Posts

Posted - 2005-07-18 : 22:07:46
Hi,

Im trying to write an sql statement that takes a start date and an end date and groups by 7 days groups showing the start date of each 7 day group.

example:

select sum(blah), <sum date function using datex>
from mytable
where (datex between '2005-07-05' and '2005-07-18')
group by <sum date function using datex>

which would give the result set:

456.87 2005-07-05
567.78 2005-07-12


Cheers,
R

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2005-07-18 : 23:52:34
Please post your table structure

mk_garg
Go to Top of Page

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2005-07-19 : 00:00:38
it may help you
http://www.sqlteam.com/item.asp?ItemID=851

mk_garg
Go to Top of Page
   

- Advertisement -