Hi there,
I want to select Date and sum(Quantity) by date from a set of records
containing Date, Quantity and RouteCardNo
My view as follows:
select distinct [Date], RouteCardNo, sum(A.Quantity) QtyA
from Prod_Assembly_Data_1 A
group by A.[Date], RouteCardNo
BUT, I just want to show the sum(quantity) by date from unique RouteCardNo
numbers, i.e. I don't want the RouteCardNo to be part of the selection and
only want the result set to contain single date records with the specific
dates' quantity.
Please help! Thank you!
Roy Harvey (SQL Server MVP) - 07 Mar 2008 13:06 GMT
>Hi there,
>
[quoted text clipped - 12 lines]
>
>Please help! Thank you!
See if this is what you want.
SELECT [date], sum(A.Quantity) as QtyA
FROM Prod_Assembly_Data_1
GROUP BY [date]
Roy Harvey
Beacon Falls, CT