Re: Compare Character to numberic
- From: Hugo Kornelis <hugo@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 28 Oct 2005 21:55:38 +0200
On Fri, 28 Oct 2005 11:35:03 -0700, Daniell wrote:
>I am new at this and am not sure I am doing it correct. I have attempted to
>convert the fields to numeric but receive the same error:
>
> Character in cast argument not valid
Hi Daniell,
If you try to convert the complete STST2.PRN2 column to numeric, than
this error is to be expected, since there's non-numeric data in that
column. If you try to convert SUBSTRING(STST2.PRN2, 7, 7) to numeric,
than I don't understand - based on the data below, this should run
without error.
(snip)
>STST2(PRN2 is defined as 132 character)
>
>AUTH2 PRN2
>2132 ORDERI 384956 10/14/05 L3049
>2752 ORDERI 192784 10/15/05 G2834
This might explain why you're not getting the desired results. If I
count characters in PRN2, the 7th character is the first space after
ORDERI. Taking 7 characters from there, I get 4 spaces and "384" for the
first row, or four spaces and "192" for the second row.
Maybe you should change the substring expression to
SUBSTRING(STST2.PRN2, 7, 10)
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)
.
- References:
- Re: Compare Character to numberic
- From: Hugo Kornelis
- Re: Compare Character to numberic
- From: Daniell
- Re: Compare Character to numberic
- Prev by Date: Re: Compare Character to numberic
- Next by Date: Re: Selecting by date
- Previous by thread: Re: Compare Character to numberic
- Next by thread: Re: password
- Index(es):
Relevant Pages
|
|