Help with Syntax Error Using IIF

  • Thread starter Thread starter Jonathan Wood
  • Start date Start date
J

Jonathan Wood

I'm trying to implement the following query:

UPDATE ScheduledDeliveries SET TargetDeliveries=IIF((TargetDeliveries +
@Increment) >= 0, TargetDeliveries + @Increment, 0)
WHERE ContractID=@ContractID AND CategoryID=@CategoryID AND DueDate=@DueDate

But I get the error: Incorrect syntax near '>'.

Can anyone spot my problem?

Thanks.

Jonathan
 
Looks like the answer is that SQL Server doesn't support IIF. So much for
meaningful error messages...

Jonathan
 
¤ Looks like the answer is that SQL Server doesn't support IIF. So much for
¤ meaningful error messages...
¤

IIF is specific to Access. The equivalent in TRANSACT SQL is the Case statement.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Back
Top