[dba-SQLServer] Convert Characters to Number

David Emerson newsgrps at dalyn.co.nz
Wed Jul 6 17:37:56 CDT 2005


Thanks Francisco and Paul.

At 6/07/2005, Francisco Tapia wrote:
>IsNumeric(LEFT(YourField,2)) = 1
>
>On 7/5/05, David Emerson <newsgrps at dalyn.co.nz> wrote:
> > SQL2000.
> >
> > I have a varchar field that stores text.  Sometimes the first 2 characters
> > will be a number.  I am looking for an easy way to check if the first two
> > characters are a valid number, and then convert them to a number so that I
> > can do some comparisons with other numbers.
> >
> > Regards
> >
> > David Emerson
> > Dalyn Software Ltd
> > 25 Cunliffe St, Churton Park
> > Wellington, New Zealand
> > Ph/Fax (04) 478-7456
> > Mobile 027-280-9348




More information about the dba-SQLServer mailing list