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
 General SQL Server Forums
 New to SQL Server Programming
 IF in a calculated field

Author  Topic 

Volkof
Starting Member

14 Posts

Posted - 2014-11-08 : 03:48:43
How is the below formula written in a calculated field in SQL?

If TransactionType = 3 then
10% * ValueTransaction else
1.5% * ValueTransaction
end if


Thanks.

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-11-08 : 09:23:04
Case transaction type
When 3 then ...
Else ...
End
Go to Top of Page
   

- Advertisement -