Is there an IIF statement in the entire version of SQL Server?
I checked the tutorial on MSDN .
But when I tried to run this code on my machine
DECLARE @newDate datetime SET @newDate = CONVERT(varchar, {fn NOW()}, 111) SELECT IIF(@newDate > '2010/12/2', 'Greater', 'smaller')
But I get the error "Invalid syntax near s β".
Can someone provide me an example in SQL Server 2005 for the existence of an IIF statement?
sql-server sql-server-2005 iif
Zerotoinfinity
source share