Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

remove .00 from string while conversion

$
0
0

How do i remove .00, .01 from the string while converting that string to int

i tried to do this

Select REPLACE(CONVERT(varchar(15), [Cases], 1), '.00', '') from table

UPDATE table
SET [CASES_d] = CAST(REPLACE(CONVERT(varchar(15), [Cases], 1), '.00', '') AS INT)

I get the error

Conversion failed when converting the varchar value '1.10' to data type int.

can somebody help


Thanks


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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