XLeratorDB/strings Online Documentation
VALUE
Updated: 30 April 2009
Use VALUE to convert a text string that represents a number to a number.
Syntax
SELECT [wctString].[wct].[VALUE] (
<@Numval, nvarchar(4000),>)
Arguments
@Numval
is the text value to be evaluated. The @Numval argument can be of data types that are implicitly convertible to nvarchar or ntext.
Return Types
float
Remarks
· The VALUE function will convert any string where wct.ISNUMERIC evaluates to TRUE
Examples
Select wct.VALUE('50%')
This produces the following result
----------------------
0.5
(1 row(s) affected)
Select wct.VALUE('1/3')
This produces the following result
----------------------
0.333333333333333
(1 row(s) affected)
Select wct.VALUE('-5 3/4')
This produces the following result
----------------------
-5.75
(1 row(s) affected)