Hi,
I have a table of sales. 3 sales for Jan, 4 for Feb, 10 for march,
etc, for the entire year.
I could
sum stuff where shipdate between "01/01/2006" and "01/31/2006"
sum stuff where shipdate between "02/01/2006" and "02/28/2006"
etc...
I am trying to come up with some kind of sql that will sum the sales
total for a month, without having to do date ranges.
select month(shipdate), sum(shipped * price) from orders where
shipdate = month(shipdate) group by shipdate
or something like that.
It would end up with
1 456
2 325
3 555
4 234
5 222
6 848
7 395
8 294
9 920
10 535
11 432
12 123
if I selected all the records for a year beginning Jan 1 and ending
December 31
Basically sum by month.
I have been trying for about 2 hours different things, sub queries,
group by having, without much luck.
Can anyone give me an idea if this is even possible?
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf