SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Case Statement
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

masond
Constraint Violating Yak Guru

447 Posts

Posted - 11/20/2013 :  10:09:46  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
6062 Posts

Posted - 11/20/2013 :  10:15:43  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000