More SQL help,
 

MegaSack DRAW - 6pm Christmas Eve - LIVE on our YouTube Channel

[Closed] More SQL help,

0 Posts
1 Users
0 Reactions
59 Views
 mrmo
Posts: 10710
Free Member
Topic starter
 

select count (distinct accountid) as NumCust,dateadd(quarter,datediff(QUARTER,0,ccx_cog_invoicedate),0) as FirstOfQuarter
from FilteredSalesOrder
group by
dateadd(quarter,datediff(QUARTER,0,ccx_cog_invoicedate),0)

I wrote this query to get a count of customers in a quarter, but what i need is slightly different, I need to be able to group by a three month period starting the first of a month. I assume that there is a way to do it???

Anyone able to offer some help? thanks.


 
Posted : 12/04/2012 10:30 am