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 Rhinorhino 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.

Anfel

Programmer
Joined
Sep 18, 2002
Messages
3
Location
US
I'm trying to use IIF function inside Select statement and getting errors. It's very simple statement: I need to see PhoneNumbers if TelephoneType <> '13', and if TelephoneType = '13' field PhoneNumber should be empty. I'm getting errors and I'm lost.

Thanks in advance
 
where access uses IIF, sql/server uses CASE

select case
when TelephoneType = '13'
then ''
else PhoneNumbers
end as PhoneNumber

rudy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top