Q. What is the equivalent of the IIF command in SQL Server? A. In Microsoft Access you would use :- Select iif(field>10,"large", "small") as Size from Table With SQL Server, use the CASE command :- SELECT Size = CASE WHEN field > 10 THEN "large" ELSE "small" END from Table Another example just using local variables :- DECLARE @V1 CHAR(10) DECLARE @V2 INT SET @V2 = 1 SET @V1 = CASE @V2 WHEN 1 THEN 'Green(1)' WHEN 2 THEN 'Orange(2)' ELSE 'Unknown(3)' END SELECT @V1 === v1.03 2000.05.02 Applies to SQL Server versions : All FAQ Categories : Application Design and Programming Related FAQ articles : n/a Related Microsoft Kb articles : n/a Other related information : n/a Authors : Neil Pike