Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 update a column removing specific characters

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-03-29 : 06:31:10
judd writes "I want to update a float data table that currently has 8 (12345678.0) character with a shorter 5 character number by removing the 1st, 3rd and 4th number (25678.0). The substring command seems to do what I want but doesn't work with float data and I'm unclear on how to which command I should use in converting the data (cast, convert, str). Any help with this would be appreciated.

Thanks in advance,
-Judd"

ijprasad
Starting Member

29 Posts

Posted - 2005-03-29 : 07:42:15
Convert it to varchar, remove the values than convert it again to float datatype and update it to the table.

Inderjeet
Go to Top of Page

amachanic
SQL Server MVP

169 Posts

Posted - 2005-03-29 : 10:30:37
Why is this column a FLOAT to begin with? There is no numeric operation to remove numbers in certain ordinal positions -- that's a string operation. Store your string data as strings, not as numerics. You'll save yourself a world of pain that way.


---
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
Go to Top of Page
   

- Advertisement -