I am just trying to add the letter A to the beginning of the results Im bring back and I keep getting this message. Query Failed. 3535 a character string failed conversion to a numeric value Thanks for any help.

select a.area_cd as CO_Area , 'A' + a.area_cd from intDDt.DIXX a 
2

2 Answers

+ is a numeric operator in Standard SQL and Teradata and not a string concat (as in MS SQL Server). You need to use || instead:

'A' || TRIM(a.area_cd) 

The TRIM results in an automatic typecast.

1

please try this,

select a.area_cd as CO_Area , ('A' + CAST(a.area_cd AS VARCHAR)) from intDDt.DIXX a 
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.