foxjazzG
SSCrazy
Points: 2221
More actions
December 14, 2010 at 8:40 am
#229585
SELECT top 1 @maxyr= convert(int,EquipmentYear), @viosum2= sum(vio) sumvio
FROM vwTimingBeltVIO
GROUP BY equipmentyear,PartNumber
HAVING (PartNumber = N't338') order by sumvio desc
equipmentyear is an nvarchar
ASDL
Old Hand
Points: 388
December 14, 2010 at 12:13 pm
#1262409
Need more information to answer this.
Looking at above statement looks like you have not declared the variables.
December 15, 2010 at 2:10 pm
#1263150
I handled it by using a cursor.
I just thought there was a better way.
December 15, 2010 at 8:53 pm
#1263274
foxjazzG (12/15/2010)I handled it by using a cursor.I just thought there was a better way.
foxjazzG (12/15/2010)
How is above error and cursor related?
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply