More SQL help,
 

Subscribe now and choose from over 30 free gifts worth up to £49 - Plus get £25 to spend in our shop

[Closed] More SQL help,

0 Posts
1 Users
0 Reactions
58 Views
 mrmo
Posts: 10709
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