Need Assistnace In Creating SQL to Get Data on a Quarterly Basis
looking for a little direction in trying to come up with some sql that will give me totals quarterly given a table of data
here is what i have for generating by year and by month, but i would like to generate the data quarterly:
input:
select
TO_CHAR (createdate,'yyyy/mm') monthofyear,
COUNT (createdate) accountscreated
from
dtree
where
subtype=142
group by
TO_CHAR (createdate,'yyyy/mm')
order by
TO_CHAR (createdate,'yyyy/mm');
sample output:
Month of Year Accounts Created
---------------- -------------------
2004/11 89
2004/12 207
2005/01 112
2005/02 322
2005/03 185
2005/04 163
2005/05 213
2005/06 164
etc, etc
any sql gurus have any handy dandy tricks ?
Thaks
jim