Tuesday, 15 January 2013

sql - Conversion Failed -


I am trying to run a SQL query It can not be ascertained where the conversion in "int" is happening. Can anyone point me in the right direction?

  "segumbar" as "top", es 2, "top, s4" from segmentValue ("as S1", LTRIM (RTRIM (b.SUMMARY_ACCT) ) Select 3 + '_' + 'account 2' as "S2", b.ACCOUNT_DESC as "S3", '^' + LTRIM (as in RTRIM (c.SUMMARY_ACCT)) + ' TEST.dbo.GLCHARTSUM "S4" as the '' Account '' on the internal form c.PARENT_OBJ_ID = b.SUMRY_ACCT_ID UNION Select all TEST.dbo.GLCHARTSUM c "S1", joining LTRIM (RTIM (CRMMIRCACTT) + '_' + 'Account' as "S2", C. ACCDDSEC "S3", L Select TEST.dbo.GLCHARTSUM c c.UMRY_ACCT_ID = b.SUMRY_ACCT_ID UNION, joining the Inner B from "S4" TEST.dbo.GLCHARTDTL as RRIIM (RTIIM (Convert (Bert (100), BACATAD)) 2 "S1 as", LTRIM (RTRIM (ACCT_UNIT)) as' '' 2 '', '' S3 '' as' '+' ', description' unit ^ '+ LTRIM (RTRIM (ACCT_UNIT) )) As "_Unit" from "S4" TEST.dbo.GLNAMES where POSTING_FLAG = 'S' UNION select all 2 "S1", LTRIM (RTRIM (ACCT_UNIT) + '_' + 'unit As "S2", as the description "S3", LTRIM (RTRIM (ACCT_UNIT)) In the form "S4" TEST.dbo.GLNAMES from where POSTING_FLAG = 'P' UNION select all 3 "as S1", MATRIX_CAT + substrings (MX_VALUE, 1,5) as "S2" Join MX_VALUE as "S3", as the account "S4" as the Inner B from TEST.dbo.GLACCMXVAL. Error:  

Message 245, Level 16 , State 1, Line 1
Conversion type 'vargar' failed to change value '^ ASSETS_Accounts' for data type int.

This error is applied to your last UNION ALL Seeing the reason. ACCOUNT is a INT value, but other S4 columns are VARCHAR .

You must enter your code in the ACCOUNT column in VARCHAR

  ... UNION ALL SELECT 3 as "S1", "S4" as the MATRIX_CAT + Substring (MX_VALUE, 1,5) AS "S2", MX_VRL "S3", Convert (VAARAAR (100), Account). .  

No comments:

Post a Comment