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

  • Home
  • SEARCH
  • 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 8078659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:51:56+00:00 2026-06-05T15:51:56+00:00

Using SQL Server 2000 table1 id values (datatype is nvarchar) 001 12:10 002 01:25

  • 0

Using SQL Server 2000

table1

id values (datatype is nvarchar)

001 12:10 
002 01:25
003 10:01
004 21:20

I want to convert the values column into float..

Tried Query

Select id, Cast(Replace(values, '':'', ''.'') as float) as values from table1

Output is showing like

001 12.1 'zero is not showing
002 01.25
003 10.01
004 21.2 'zero is not showing

Why zero is hiding..? 2.10 or 2.1 is same for the float datatype but user will get confuse 2.1 like 2 hour 1 minutes instead of 2 hours 10 minutes…

How to solve this problem

Expected Output

id values (datatype is float)

001 12.10 
002 01.25
003 10.01
004 21.20

Need SQL Query Help

  • 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. Editorial Team
    Editorial Team
    2026-06-05T15:51:58+00:00Added an answer on June 5, 2026 at 3:51 pm

    12.10 and 12.1 are both string representations of the same float (twelve plus one tenth). If you want the data type to be float you cannot specify its string representation. You can only do that when converting a float into a string, which would be a pointless exercise in your case (since you already have this value as a string).

    Another data type instead of float, such as decimal, which has a fixed number of decimal places, might be a more appropriate choice for your task.

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

Sidebar

Related Questions

Using SQL Server 2000 Table PersonID Date 001 11-02-2009 002 11-02-2009 003 11-02-2009 001
Using SQL Server 2000 table 1: ID LastDate 001 20090101 003 20090501 004 20090302
Using sql server 2000 Date Column datatype is varchar Table1 ID Date 01 20100122
Using SQL Server 2000 Table1 ID date value 001 23/01/2012 100 002 25/02/2012 200
Using SQL Server 2000 Table1 ID Date Value1 Value2 001 01/01/2012 100 0 001
Using SQL Server 2000, Date Column Datatype is varchar... In my table date column
Using SQL Server 2000 Having Two Tables Table1 Date ID 20090101 001 20090102 001
I am using SQL Server 2000. When I try to update a column of
work on SQL Server 2000. want to Automated Email Notifications using SQL Server Job
Using SQL Server 2000 dtptime - datetimepicker (Format: Custom Format(HH:mm) Query insert into table1

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.