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.