Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Fraction to number TSQL conversion

$
0
0

I have a database column, "my_value",  that is a NVARCHAR data type.

I would like to convert that "my_value" from i.e. 1/4 to .25

Is there a function or series of functions I can use to get this done?  I do this for values that are numeric and it works fine:

CASE WHEN ISNUMERIC(my_value)= 1  THEN cast (my_value as float) ELSE cast (0 as float) END AS my_value2

Thank you in advance.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>