The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.
SELECT
SUM(T.SalesBal7) As July_2008,
SUM(T.SalesBal8) As Aug_2008,
SUM(T.SalesBal9) As Sept_2008,
SUM(T.SalesBal10) As Oct_2008,
SUM(T.SalesBal11) As Nov_2008,
SUM(T.SalesBal12) As Dec_2008
FROM arcpsale T
Left Outer Join arcusts T1 On T.CustID = T1.CustID
WHERE T1.CustAcct ='MAINE130^'
and T.FiscalYear =2008
SELECT
SUM(CASE WHEN T.FiscalYear = 2008 then T.SalesBal7 else 0 END) As July_2008,
SUM(CASE WHEN T.FiscalYear = 2008 then T.SalesBal8 else 0 END) As Aug_2008,
SUM(CASE WHEN T.FiscalYear = 2008 then T.SalesBal9 else 0 END) As Sept_2008,
SUM(CASE WHEN T.FiscalYear = 2008 then T.SalesBal10 else 0 END) As Oct_2008,
SUM(CASE WHEN T.FiscalYear = 2008 then T.SalesBal11 else 0 END) As Nov_2008,
SUM(CASE WHEN T.FiscalYear = 2008 then T.SalesBal12 else 0 END) As Dec_2008,
SUM(CASE WHEN T.FiscalYear = 2009 then T.SalesBal1 else 0 END) As Jan_2009,
SUM(CASE WHEN T.FiscalYear = 2009 then T.SalesBal2 else 0 END) As Feb_2009,
SUM(CASE WHEN T.FiscalYear = 2009 then T.SalesBal3 else 0 END) As Mar_2009,
SUM(CASE WHEN T.FiscalYear = 2009 then T.SalesBal4 else 0 END) As Apr_2009,
SUM(CASE WHEN T.FiscalYear = 2009 then T.SalesBal5 else 0 END) As May_2009,
SUM(CASE WHEN T.FiscalYear = 2009 then T.SalesBal6 else 0 END) As Jun_2009
FROM arcpsale T
Left Outer Join arcusts T1 On T.CustID = T1.CustID
WHERE T1.CustAcct ='MAINE130^'
and T.FiscalYear BETWEEN 2008 AND 2009
SELECT
SUM(CASE T.FiscalYear WHEN 2008 then T.SalesBal7 else 0 END) As July_2008,
SUM(CASE T.FiscalYear WHEN 2008 then T.SalesBal8 else 0 END) As Aug_2008,
SUM(CASE T.FiscalYear WHEN 2008 then T.SalesBal9 else 0 END) As Sept_2008,
SUM(CASE T.FiscalYear WHEN 2008 then T.SalesBal10 else 0 END) As Oct_2008,
SUM(CASE T.FiscalYear WHEN 2008 then T.SalesBal11 else 0 END) As Nov_2008,
SUM(CASE T.FiscalYear WHEN 2008 then T.SalesBal12 else 0 END) As Dec_2008,
SUM(CASE T.FiscalYear WHEN 2009 then T.SalesBal1 else 0 END) As Jan_2009,
SUM(CASE T.FiscalYear WHEN 2009 then T.SalesBal2 else 0 END) As Feb_2009,
SUM(CASE T.FiscalYear WHEN 2009 then T.SalesBal3 else 0 END) As Mar_2009,
SUM(CASE T.FiscalYear WHEN 2009 then T.SalesBal4 else 0 END) As Apr_2009,
SUM(CASE T.FiscalYear WHEN 2009 then T.SalesBal5 else 0 END) As May_2009,
SUM(CASE T.FiscalYear WHEN 2009 then T.SalesBal6 else 0 END) As Jun_2009
FROM arcpsale T
Left Outer Join arcusts T1 On T.CustID = T1.CustID
WHERE T1.CustAcct ='MAINE130^'
and T.FiscalYear BETWEEN 2008 AND 2009
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
Sql server function help | 15 | 37 | |
TSQL - How to declare table name | 26 | 42 | |
SQL Stored Proc - Performance Enhancement | 15 | 55 | |
how to double quote a string for an inline sql statement. | 8 | 73 |
Join the community of 500,000 technology professionals and ask your questions.