Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Conversion failed when converting the varchar value to data type int

$
0
0

Hello,

Running out of ideas how to fix this case. I am getting  an error: Error converting data type varchar to numeric.

      CASE
        WHEN sopHdr.SOPTYPE = 4
        THEN CONVERT(int,(sopHdr.DOCAMNT - inv.TaxTotal) - CONVERT(int, inv.CostTotal)) * - 1 * CONVERT(int,proj.UserText1) / 100.0
                    ELSE CONVERT(int,(sopHdr.DOCAMNT - inv.TaxTotal) - inv.CostTotal) * CONVERT(int,proj.UserText1) / 100.0
        END

Please help.


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>