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)
 Extract just number from value e.g. 1024 MB

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-10-05 : 07:19:56
Patricia writes "I use a server monitoring software which writes values to a sql database, the return for diskspace is written to a column with datatype set to varchar (System set up tables etc) basically I am running reports on the data and want to be able to just extract numeric value and not the char in order to convert it to a real number for graphs. The value is 1024 MB and I want to extract just 1024 to the results set, can this be done ???"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-10-05 : 07:35:10
See if this helps you
http://weblogs.sqlteam.com/brettk/archive/2005/06/22/6328.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2005-10-05 : 07:36:07
Yes - look at the following functions in Books Online:
SUBSTRING
CHARINDEX
PATINDEX


Duane.
Go to Top of Page
   

- Advertisement -