SQL Statement Problem

Hello all,

Question on SQL statement in MS SQL Server.

I have a database of Sales Analysis which contains the month of each transaction.

I want to group the qty sold quarterly, i.e Jan-Mar, Apr-Jun, Jul-Sep,Oct-Dec, sum it, and find the average by each quarter.

I understand that one of the way is to use CASE. Need help, a newbie.

Thank you all in advance. Really appreciate your help.
[431 byte] By [ode2eba] at [2007-11-20 4:44:46]
# 1 Re: SQL Statement Problem
you can use the SQL Method called DatePart(). It actually has a default setting for Quarterly. its like
DATEPART("q",THEDATE);

more info on it here
http://msdn2.microsoft.com/en-us/library/ms174420.aspx

hth,
mcm
mcmcom at 2007-11-9 13:44:42 >
# 2 Re: SQL Statement Problem
Thank you..That was very useful
ode2eba at 2007-11-9 13:45:43 >
# 3 Re: SQL Statement Problem
glad i could help.
mcm
mcmcom at 2007-11-9 13:46:41 >