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
 Case Statement

Author  Topic 

masond
Constraint Violating Yak Guru

447 Posts

Posted - 2013-11-20 : 10:09:46
Hey all
I need some help
Aim - All i need is a basic case statement to say,

When [Projected_FDGL_terminal_commission__c] > 0, and [Joining_Fee__c]
& [Non_Repeatable_Income__c] = 0 then ‘Terminal Upgrade’ end as “Indicator”

really looking forward to your help

Regards
D

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2013-11-20 : 10:15:43
Not sure if you meant this:

select case
when [Projected_FDGL_terminal_commission__c] > 0
and [Joining_Fee__c] = 0
and [Non_Repeatable_Income__c] = 0 then 'Terminal Upgrade'
else NULL
end as [Indicator]
from <yourTable>
where <conditions>

OR this:

select case
when [Projected_FDGL_terminal_commission__c] > 0
and [Joining_Fee__c] + [Non_Repeatable_Income__c] = 0 then 'Terminal Upgrade'
else NULL
end as [Indicator]
from <yourTable>
where <conditions>

but this should give you the syntax to work with


Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -