I am trying to use Case in Update query and it gives me an error that there is an Incorrect syntax near case. I am not sure where?! This is in SQL 2005
I am sending the date to the stored procedure. If the Date sent is ’01/01/1905′, it has to save null else the real date entered. I am really not sure what is wrong in this statement.
Update Manifest set Notes = @Notes, IsCustom = @IsCustom,
CASE WHEN @ProofSent = CONVERT(datetime, '01/01/1905') THEN NULL ELSE @ProofSent END,
CASE WHEN @ProofApproved = CONVERT(datetime, '02/01/1905') THEN NULL ELSE @ProofApproved END
Thanks in advance!
It must be sth like this: