-
Iif and SQL Server 2000
In Access 2000 you can execute a query like
SELECT IIF([cyCompany]= '<No Company>',[HomeStreet],[CyBusinessStreet]) AS BusinessHomeStreet
FROM Companies
but in SQL Server 2000 it generates a problem. Does SQL Server 2000 supports this command and if no what's the best workaround?
-
You could try using the CASE statement:
Code:
SELECT
CASE WHEN [cyCompany] = '<No Company>' THEN
[HomeStreet]
ELSE
[CyBusinessStreet]
END AS BusinessHomeStreet
FROM Companies
I use that in SQL Server7, so it should work in 2000.
-