Set the values of varibles

  • Hello,

    I'm using varibles and incrementing them in a while loop. Only problem is I can't seam to set the values of the varible. I know it will have a simple solution but cant find an answer anywhere to help!

    DECLARE @Counter int

    @Counter = 1

    WHILE (@Counter < @NumRate)

    BEGIN

    @Counter = @Counter + 1

    END

    What do i need to do to set the value to 1 and increment it in the while?

     

    huge thanks

  • I'd start by actually setting the variable, that might help you a little

    SET @Counter = 1

    (don't forget to set in in the while loop too)

  • Cheers

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply