I've searched through some other answers but haven't gotten this to work how I expect.
My query:
SELECT
CONVERT(VARCHAR(18),[Trx_Date],110) AS Date
,[TRX_TYPE]
,SUM([QUAN]) AS QUANt
FROM [VM].[dbo].[INVTRX]
WHERE SKU='7342761' AND TRX_TYPE!='S' AND TRX_DATE BETWEEN '12-15-2016' AND '12-18-2016' AND ID_CONT=557
GROUP BY QUAN, Trx_Type, TRX_DATE
My Results:
Date ---- TRX_TYPE ---- QUANt
12-15-2016 ---- PT ---- 48.0000
12-16-2016 ---- PT ---- 78.0000
12-16-2016 ---- PT ---- 90.0000
What I am looking for:
Date ---- TRX_TYPE ---- QUANt
12-15-2016 ---- PT ---- 48.0000
12-16-2016 ---- PT ---- 168.0000
Also, a bonus question: How do I format tables on Stackoverflow?
Thanks for any help!
QUANfromgroup by.