Reputation: 23901
I am trying to run sql written in Access on sql server. The query is throwing a syntax error on line 4:
UPDATE mytablename SET
table.[Specimen Collection Date 1] =
IIf(
[Specimen Collection Date 2] Is Not Null, //incorrect syntax near is
[Specimen Collection Date 2],
IIf([Specimen Collection Date 2] Is Null,[Specimen Collection Date 3] Is Not Null))
It seems like a valid column name [Speciment Collection Date]
seems like a valid expression.
What am I missing?
Upvotes: 0
Views: 97
Reputation: 7066
There is no IIf in sql. Look up the case when
tsql convention.
http://msdn.microsoft.com/en-us/library/ms181765.aspx
Upvotes: 1
Reputation: 7147
You don't need to include the TABLE in your column definition. The DB knows what table it is from your "Update TABLE" statement.
Upvotes: 0