i am creating a table using table designer and i want to add a computed column for Age as follows:
CASE WHEN BirtheDate IS NULL THEN NULL
WHEN DATEDIFF(yy,BirthDate, CURRENT_TIMESTAMP) >50 THEN 'OLDER'
WHEN DATEDIFF (yy, BirthDate, Current_Timestamp)>40 then 'middle age'
else 'younger'
END
however, whenever i type this code i get an error. is there something that i should change to get it work?
is it possible to use case in table designer for a computed field?
Any answers i would be grateful.
thanks
sukai