Rudy
I simplified your structure a littel bit , but I'm sure you will get an
idea
create table #t (NewCredit int,Credits int ,USERID int)
insert into #t values (10,20,1)
insert into #t values(1,30,1)
insert into #t values(88,58,20)
declare @win int
set @win=1000
update #t set NewCredit =case when userid in(select userid from #t where
userid=1) then Credits+@win else 0 end
select * from #t
drop table #t
[quoted text, click to view] "Rudy" <Rudy@discussions.microsoft.com> wrote in message
news:E8EE4071-75C9-44C5-9DF3-0CB67C013681@microsoft.com...
> Hello All!
>
> Seem to be having a little problem with a syntax error on this.
>
> UPDATE Bankroll
> IF UserID IN (SELECT USERID FROM tblUserID WHERE Pass = '1')
> SET NewCredit = Credits + Cast(@win as int)
> ELSE
> SET NewCredit = '0'
>
> SQL tells me incorrect syntax near IF and near "="
>
> Any thoughts?
>
> Thanks!
>
> Rudy