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
 Transact-SQL (2000)
 Checking data on 1 field and writing to another

Author  Topic 

igorblackbelt
Constraint Violating Yak Guru

407 Posts

Posted - 2006-02-17 : 13:37:47
Guys -

I'm kind of confused on how to attack this, I have field1 and field2, if field1 = 1, 2, 3, 4 and 5 then field2 = US$5,00, if not then field2 = 0.
I completely forgot or don't know how to do this... Let me know if anyone can help.

Thanks in advance.

---

Thanks!
Igor.

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-02-17 : 16:04:53
U want to insert or update or select or something else ?

u may be able to use "Case" --> Check in BOL for syntax of "Case"

or if its update

Update urtbl Set field2 = 5
where field1 in (1,2,3,4,5)

Update urtbl Set field2 = 0
where field1 not in (1,2,3,4,5)
Go to Top of Page
   

- Advertisement -