I have a table with a telephone number, rating period and minutes. I want to run a query grouped by telephone number that will have as columns:
Phone Number | Sum(where rating period =1) | Sum(where rating period =2) | Sum(where rating period =3) I have had very bad luck so far, seems I can only get one sum at a time. If someone could point me in the right direction I would be grateful. I don't know if it is possible with one query. ?Maybe I have to create a table in memory and add columns to it, but I don't really know how to do this. Is this possible with mysql. The SQL of a successful query from Access was: TRANSFORM Sum(tblAllDataExportMarch.[Call Minutes]) AS [SumOfCall Minutes] SELECT tblAllDataExportMarch.[Service Number], Sum(tblAllDataExportMarch.[Call Minutes]) AS [Total Of Call Minutes] FROM tblAllDataExportMarch GROUP BY tblAllDataExportMarch.[Service Number] PIVOT tblAllDataExportMarch.[Rating Period]; TIA, Dan --------------------------------------------------------------------- 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