Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

iif function

Status
Not open for further replies.

junkmail

Programmer
Jan 7, 2001
134
0
0
US
Can you use an iif function in the column of a view?
 
No. Instead, use a case statement. Same functionality, different syntax.

Ex:

[tt]
Select Col1,
Col2,
Case When This = That Then Col3 Else Col4 End As ColumnAlias
[/tt]

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top