The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!
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 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
Open in new window