Page 1 of 1

how to convert Nvarchar to Numeric

Posted: Thu May 10, 2007 1:49 pm
by srao
how to convert Nvarchar to Numeric value

Posted: Thu May 10, 2007 2:03 pm
by DSguru2B
In server there are no datatypes internally, they are all stored as characters. So if you mean you want to extract numbers from an alphanumeric string then you can use OCONV with MCN conversion code. If you mean something else then please explain.

Posted: Thu May 10, 2007 4:21 pm
by ray.wurlod
If the VarChar contains a valid number, perform some arithmetic, such as adding zero to it.

Code: Select all

If Num(InLink.TheString) Then InLink.TheString + 0 Else InLink.TheString