mrb2073
Starting Member
1 Post |
Posted - 2014-07-22 : 11:53:20
|
I have been using SQL for a few years now but am completely new to reporting. I am trying to run a query that returns multiple counts in Visual Studio. Right now I am able to get the numbers I need for the month of Jan but would like to add additional columns for each month to my results. Any help would be appreciated.Thanks***************SELECT CODESSERVICEAUTHREQUESTGROUPS.CODE, COUNT(SAREQUESTS.ID) AS JAN_14FROM SAREQUESTS INNER JOIN CODESSERVICEAUTHREQUESTGROUPS ON SAREQUESTS.ASSIGNTOGROUP = CODESSERVICEAUTHREQUESTGROUPS.ID INNER JOIN CODESSERVICEAUTHREQUESTSTATUSES ON SAREQUESTS.TASKSTATUS = CODESSERVICEAUTHREQUESTSTATUSES.IDWHERE (SAREQUESTS.ASSIGNTOGROUP IN (2247, 2224, 1068, 52, 2092, 2211, 2197, 2231, 42, 2127, 15, 2214, 2248, 2243, 29, 2278, 51, 2239, 2223, 2249, 2250, 45, 2233, 54, 58, 2226, 2225, 2240, 2182, 2217)) AND (SAREQUESTS.DATERECEIVED < CONVERT(DATETIME, '2014-02-01 00:00:00', 102)) AND (SAREQUESTS.DATERECEIVED >= CONVERT(DATETIME, '2014-01-01 00:00:00', 102))GROUP BY SAREQUESTS.ASSIGNTOGROUP, CODESSERVICEAUTHREQUESTGROUPS.CODEORDER BY JAN_14 DESC |
|