question

Wiz avatar image
Wiz asked

query conversion error

how do I fix this error: Conversion failed when converting the varchar value '99.9' to data type int. in this query: select c.duns, cast(round(a.g1p_1/100,2)as varchar)* D_AR + cast(round(a.g1p_2/100,2)as varchar)* D_AR + cast(round(a.g1p_3/100,2)as varchar)* D_AR + cast(round(a.g1p_4/100,2)as varchar)* D_AR as G1P_GP from Raw_Survey_Data_Test. dbo.S3000_GP a inner join Raw_Survey_Data_Test. dbo.S3000GP_CompanyInfo b on a.RESPNUM = b.respnum inner join Raw_Survey_Data_Test.dbo.MOD_SHIP c on b.duns=c.duns
sqlquerycast
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
rj_leo avatar image
rj_leo answered
cast or covert the a.g1p_x quotient into a float or numeric.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Wiz avatar image Wiz commented ·
thanks worked
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.