SQL0802 Data conversion or data mapping error
The fields not being CAST
are decimals. The fields I am trying to CAST
are strings.
I have tried different variations or CAST
and CONVERT
on this case
expression. I'm fairly certain this syntax is correct. I am still getting the error though.
CASE WHEN cpssn=amssn THEN amfnam||amlnam
WHEN cpssn=CAST(maassn as DECIMAL(9)) THEN maafnm||maalnm
WHEN cpssn=CAST(mpssno as DECIMAL(9)) THEN mppfnm||mpplnm
END as Name