Sometimes, all ya have to do is hit the send button on the email to the cf-talk list and the solution comes to ya. Duh.
Here's the solution, for those that are interested. SELECT SUM(DECODE(SIGN((age/30)-1), -1, 1, 0)) AS young, SUM(DECODE(SIGN((age/79)-1), 1, 1, 0)) AS old, SUM(DECODE( (SIGN((age/40)-1) + SIGN((age/29)-1)), 0, 1, 0)) AS thirties, SUM(DECODE( (SIGN((age/50)-1) + SIGN((age/39)-1)), 0, 1, 0)) AS forties, SUM(DECODE( (SIGN((age/60)-1) + SIGN((age/49)-1)), 0, 1, 0)) AS fifties, SUM(DECODE( (SIGN((age/70)-1) + SIGN((age/59)-1)), 0, 1, 0)) AS sixties, SUM(DECODE( (SIGN((age/80)-1) + SIGN((age/69)-1)), 0, 1, 0)) AS seventies FROM (SELECT trunc(months_between(sysdate, q1)/12, 0) AS AGE, q1 FROM flpweb.tcy_pretest GROUP BY trunc(months_between(sysdate, q1)/12, 0), q1 ORDER BY months_between(sysdate, q1)/12) a Deanna Schneider Interactive Media Developer [EMAIL PROTECTED] ______________________________________________________________________ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists