Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

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

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

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


Flowing Fount of Yak Knowledge

6065 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
Go to Top of Page
  Previous Topic Topic Next 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.02 seconds. Powered By: Snitz Forums 2000