I have the following sql statement that works fine currently. I would like the sum case field month to actually be the current month. so when I run this now it should be as may when viwed.
sum(case when datedif = '12' then quantity else 0 end) as month
(SELECT INV1.ItemCode, INV1.WhsCode, OINV.CardCode, OINV.ShipToCode, INV1.SubCatNum, INV1.U_SIF_CustPartRev, INV1.Quantity, OINV.DocDate, datediff(Month,oinv.docdate,CONVERT(DATETIME, '2011-05-02 00:00:00', 102))as DATEDif
FROM OINV INNER JOIN
INV1 ON OINV.DocEntry = INV1.DocEntry
WHERE (OINV.DocType = 'i') AND (INV1.ItemCode = 'SP009600079-31T') AND (INV1.WhsCode = '10') AND (OINV.CardCode = '9600') AND (OINV.ShipToCode = '32')