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 |
|
Vack
Aged Yak Warrior
530 Posts |
Posted - 2010-03-24 : 15:57:38
|
| Table: iminvtrx_sqlselect source, item_no, loc, doc_dt, doc_type, quantityfrom iminvtrx_sqlHow can I modify this statement to multiply "quantity" by -1 if source = 'O' and doc_type = 'R'Or do I have to create a new field???? |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-03-24 : 16:07:41
|
select source, item_no, loc, doc_dt, doc_type, case when source = 'O' and doc_type = 'R' then quantity * -1 else quantity end as quantityfrom iminvtrx_sql No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|