|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: 2 days ago @ 5:14 AM
Points: 85,
Visits: 403
|
|
This is working great but I need to add another piece and my brain just cant get it. So, Thanks
([CONV CODECURNRC] == "CAD" ? [CONV AMTNETTOT] - [CONV Payments] : ([CONV AMTNETTOT] - [CONV Payments]) * [CONV EXCHRATEHC])
What I need to do is evaluate the above statement and if it evaluates to < = 0 THEN 0, Otherwise evaluate just the above statement.
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Yesterday @ 5:12 AM
Points: 4,226,
Visits: 9,458
|
|
You could add another level of nesting:
Expression < 0 ? 0 : Expression
where expression is the entire statement you currently have.
Or - slightly unorthodox - add another derived column transformation after this one and you can build another expression using the column you have just created. Avoids the nasty nesting.
____________________________________________________________________________________________
Help us to help you. For better, quicker and more focused answers to your questions, consider following the advice in this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
If you are asking for help and your post does not contain a question, you should expect responses which do not contain any answers. Put a question mark in there somewhere - it's not rocket science.
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: 2 days ago @ 5:14 AM
Points: 85,
Visits: 403
|
|
| I figured this one out by using the && operator. Thanks
|
|
|
|