SQLTeam.com | Weblogs | Forums

Will not group by


#1

Code:
select rtrim(PARTNUMBER) as [Part Number]
, sum(QSHIP) as [Qty]
from WO_LINE
where PARTNUMBER = '334S609'
and ADDED_DTE > DATEADD(M, -12, getdate())
group by PARTNUMBER, QSHIP

Result:
Part Number Qty
334S609 5.000000000
334S609 2.000000000
334S609 18.000000000

How do I get this to return one line with 25 as the Qty?


#2

Leave off the QSHIP; that's what you want to aggregate.


#3

Ha, that was easy. As you might tell, I'm a beginner.

Thanks


#4

We all were....and in many ways still are...