dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: SQL
Expertise: Beginner
Aug 30, 2005

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Achieving IIF Functionality in T-SQL

The syntax for the IIF command in T-SQL is:

select 
case <condition>
when <value1> then <result1>
when <value2> then <result2>
....
else <result3>
end
from <table1>
In the following example, the bit data type will store either 0 or 1. Using the IIF query, a result is provided in a meaningful way as follows:

select case availability 
    when 0 then 'Not Available' 
    else 'Available' 
end 
from table1
Where availability is the field name in table1, datatype bit.
Jaya Nehru Kumar
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date