Leif, > What a thorough and thoughtful response! It works like a charm. > > I'd like to generate a report based on all 12 months of the year but for > some strange reason (and I'm guessing you already knew this) the method you > suggested only works up to 11. Why is this? What should I do? > > And, it shouldn't be a big deal to just execute a second and third query > that does the row totals for each line and a grand total of all the > subtotals.
Why not go for broke and make it all work in one go!? What does your current query look like, and what errmsg are you getting? When you talk about one year, it is now (let us say) March, so will the January and February 'numbers' be from this year, and all the others from last year? How do you define this? Warning: at present, if there is more than one year's data in the tbl, then there will be confusion between years. Do you have data in the tbl for every month of the year? Regards, =dn --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php