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.
| Author |
Topic |
|
saintwade
Starting Member
2 Posts |
Posted - 2004-11-11 : 12:30:35
|
Hi! I am new to obviously new to SQL and have been tasked with substituting some fields in our buyer code field (FBUYER) within the item master table (INMAST) in or SQL 2000 DB.Overview: in INMAST, based on current value of FPRODCL make changes to FBUYER.Detail:1) select all records where FBUYER = LLN or LLV. Make no changes to these elements2) all other records where FBUYER not = to LLN or LLV: change as followsif FPRODCL= change FBUYER0x = 01x = 12x = 25x = 5If you can tell me what the code should be, I would appreciate it. I would also appreciate just a point in the right direction.Thanks, Wade  |
|
|
amachanic
SQL Server MVP
169 Posts |
Posted - 2004-11-11 : 14:09:02
|
| If I understand your requirements, I think you want:UPDATE INMASTSET FBUYER = CASE FPRODCL WHEN '0x' THEN '0'WHEN '1x' THEN '1'WHEN '2x' THEN '2'WHEN '5x' THEN '5'ENDWHERE FBUYER NOT IN ('LLN', 'LLV') |
 |
|
|
saintwade
Starting Member
2 Posts |
Posted - 2004-11-11 : 17:59:31
|
amachanic,Thanks!I have a test database that I will run this on and adjust as necessary.Wade |
 |
|
|
|
|
|