I have this small error in SQL View:
SELECT CASE
WHEN CustomerID > 1 THEN CustomerPIN
WHEN SupplierID > 1 THEN SupplierPIN
END AS FullNames
CustomerPIN and SupplierPIN are varchar fields in the table
Everything is fine when the result is null, empty or alphabets, but when I pick a valid numeric PIN, it returns a Conversion failed when converting the varchar value '123' to int
PIN can have string all literal text 'P002' or all numeric text '0023' or 'P_001', but all are varchar data types whichever the case. iT
What am I missing to complete this? I think I should somehow wrap the result but can't guess it!
I looked at this but can't seem to get it still... SQL Conversion Error in view
Thanks.