Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Problem with counter incrementing in loop in sproc

Author  Topic 

mj
Starting Member

25 Posts

Posted - 2001-08-28 : 09:57:56
The code below is what I have so far with my sproc, the only problem is that the variable @Counter is not incrementing in the loop. Can anyone see an error with this, and if so, could you please point me in the right direction.

Thanks,
mj

Declare @counter int

Set @Counter = 0
--Declare @InsertDate varchar(25)

While @Counter < 6


Select DailyRate, Borrower, CusipNoFull, dateofrate from vVrdbDailyRates Where DateOfRate between dateadd(day,-@Counter, GetDate()) and GetDate()
order by DateOfRate desc




Set @Counter = @Counter +1

   

- Advertisement -