Hey
below is a table i created
ProductId ----- Qty -------
1 ----- 2 -------
2 ----- 2 -------
1 ----- 2 -------
1 ----- 2 -------
2 ----- 2 -------
1 ----- 2 -------
Wat i am trying to do is get my sql statement select and display my result like
ProductId ----- Qty -------
1 ----- 8 -------
2 ----- 4 -------
Below is my code
Quoted Text Here
SELECT Detail.ProductID , Sum (Distinct Detail.Qty)as Qty , Head.SalesDate
FROM Detail INNER JOIN
Head ON Detail.HeadID = Head.HeadID
Where datepart(month,getdate()) = MONTH ( SalesDate )
Group By Detail.ProductID, Detail.Qty , Head.SalesDate
Quoted Text Here
The secon half works how do i get the first bit to work
Thanks