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
 SQL Server Development (2000)
 hi

Author  Topic 

lakshmirk
Starting Member

1 Post

Posted - 2011-05-20 : 09:24:04
how to get order numbers based on quarters
here quarter means
1.jan-mar
2.apr-jun
3.jul-sep
4.oct-dec

lakshmi.p

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-05-20 : 09:51:24
select datepart(yy,orderdate), datepart(qq,orderdate), count(*)
from orders
group by datepart(yy,orderdate), datepart(qq,orderdate)
order by datepart(yy,orderdate), datepart(qq,orderdate)


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -