Re: Aggregate by calandar weeks?
Posted in 1993
mcfallry@cps.msu.edu (Ryan L Mcfall) writes: >dale.s.walkowicz (dsw@cbnewsm.cb.att.com) wrote: >: I need to write a query to aggregate numbers by calandar weeks >: (Mondy to Sunday). It isn't obvous how to do that. Has anyone figured >: this out before (or figured out it can't be done)? I'd appreciate >: any help. >I have had a simlar problem, but aggregating by month rather than >by week. If anyone knows an easy way to do this, please post!! You should be able to: SELECT MONTH(datecolumn), SUM(whatever) FROM table GROUP BY 1 ORDER BY 1 The MONTH() function returns a number 1-12 for the corresponding month of the DATE column passed. Any aggregate (not just SUM) should work this way. ================ Dennis J. Pimple Informix CSE / Denver 303-850-0210