Skip to content
Advertisement

Syntax error Missing operator in my case statement

I got an error with the below SQL I wrote in ACCESS, where is my mistake? I’ve other when statements to add

UPDATE daily_inventory t0
SET 
t0.Type = CASE  
    WHEN t0.[item number] LIKE "*-FG-*" 
    THEN "Float"
END

enter image description here

Advertisement

Answer

MS Access won’t support CASE expression use IIF() instead :

UPDATE daily_inventory AS t0
     SET t0.[Type] = IIF(t0.[item number] LIKE "*-FG-*", "Float", '<whatever>')
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement