Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 145425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:25:16+00:00 2026-05-11T08:25:16+00:00

Assuming the following data: Column1 (data type: varchar(50)) ——– 11.6 -1 1,000 10 Non-Numeric

  • 0

Assuming the following data:

Column1 (data type: varchar(50)) -------- 11.6 -1 1,000 10'     Non-Numeric String 

I have a query, which is pulling data from this column and would like to determine if the value is a number, then return it as such in my query. So I am doing the following

SELECT CASE        WHEN IsNumeric(Replace(Column1, ''', '')) = 1 THEN Replace(Column1, ''', '')        ELSE 0    END AS NumericValue 

SQL is reporting back:

Conversion failed when converting the varchar value ‘11.6’ to data type int.

Why? I have also tried to force cast this:

SELECT CASE        WHEN IsNumeric(Replace(Column1, ''', '')) = 1 THEN cast(Replace(Column1, ''', '') AS float)        ELSE 0    END AS NumericValue 

And I got:

Error converting data type varchar to float.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T08:25:17+00:00Added an answer on May 11, 2026 at 8:25 am

    You need to replace comma with a period:

    CAST(REPLACE(column, ',', '.') AS FLOAT) 

    SQL Server outputs decimal separator defined with locale, but does not unterstand anything but a period in CASTs to numeric types.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assuming I have a table SomeTable with the following data: Primary Key Column1 Column2
Assuming I have the following two JQuery functions - The first, which works: $(#myLink_931).click(function
Assuming I have the following strings: string str1 = Hello World!; string str2 =
Assuming the message argument is a string, I have the following snippet: users.each do
Assuming the following text file, which is actually a data dump of funds and
I have the following data that really should be one JSON string however I
Assuming I have lines of data like the following that show user names and
Assuming A.sql contains the following code, then second Select query won’t be executed due
Assuming you have the following XML: <?xml version=1.0 encoding=utf-8?> <content> <info> <media> <image> <info>
I have the following (simplified) code: var Foo = (function () { var data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.