Hi i have column with data type as Varchar.The coloumns contains the numbers with decimal point in between for ex: 789.24,7892.5 etc. How can i remove those decimal points. I want the result set as
Thanks in advance.
you picked a great example; in your presentation, if you removed the decimal, how do you know that
78925 is not one of these values: 7892.5 ,789.25 or 78925? don't you really need to round them up or down to the integer value, instead of stripping decimal? or multiply by 100 to get consistent values?
anyway you could do it like this:
SELECT REPLACE(CONVERT(varchar, 7892.5),'.','')
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!