can someone help, I get the error scalar variable "@maxyr"

  • 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

  • Need more information to answer this.

    Looking at above statement looks like you have not declared the variables.

  • I handled it by using a cursor.

    I just thought there was a better way.

  • foxjazzG (12/15/2010)


    I handled it by using a cursor.

    I just thought there was a better way.

    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