Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IIF In Select - How To?
Message
From
19/03/2010 11:47:04
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
IIF In Select - How To?
Environment versions
SQL Server:
SQL Server 2005
Application:
Desktop
Miscellaneous
Thread ID:
01455728
Message ID:
01455728
Views:
83
I'm trying to add a status column to a select statement based on the contents of a different file. I'm trying to pull the customer number from the customer file and the value of 1 or 3 as nstatus. This status value needs to be 1 if the customer is found in the following (select custno from arship where dContract_Exp is null) and 3 if it is not.
select custno, iif(custno in (  select custno from arship where dContract_Exp is null ), 1, 3) as nstatus from dbo.customer
TIA
Jeff
Next
Reply
Map
View

Click here to load this message in the networking platform