View Single Post
Old 10-22-2012, 03:50 PM   PM User | #1
MaDmiX
Regular Coder

 
Join Date: Feb 2012
Location: Charlotte, NC
Posts: 104
Thanks: 26
Thanked 0 Times in 0 Posts
MaDmiX is an unknown quantity at this point
Converting MS Access iif statement in SQL

Hi All,

How would I write the following MS Access query in an SQL statement:
Code:
SELECT IIf([Network_1]=-1,"Net-1",IIf([Network_2]=-1,"Net-2",IIf([Network_3]=-1,"Net-3",""))) AS Network
FROM tblOnAirActivity;
I have a table with three columns that are each true/false and I want to "merge" them such that the query will reflect one column with a unique string for each record where a given table column is true and an empty string (or nothing) where none of the table columns are true.

Thanks in advance for your help.

Kind regards,

Ken
MaDmiX is offline   Reply With Quote