Re: Compare Character to numberic



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)
.



Relevant Pages

  • Re: TestN in free format -- is this the proper way?
    ... // contains non-numeric data ... // contains numeric data ... %CHECK returns the first position of the string base that contains a ... character that does not appear in string comparator. ...
    (comp.sys.ibm.as400.misc)
  • RE: Pulling a # from a sheet bound text string
    ... What I'm trying to extract is the number housed in that string; ... "BoniM" wrote: ... finds the location of the first space after the 11th character and subtracts ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Excel Sort?
    ... It finds the first space and returns the text after that character. ... Jim Cone ... such as, everything to the right of 6346, 6510 and so forth and trickier ...
    (microsoft.public.excel.misc)
  • RE: Pulling a # from a sheet bound text string
    ... finds the location of the first space after the 11th character and subtracts ... "Arturo" wrote: ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Freeing buttons created in a dynamic array
    ... > BtnWidth, BtnHeight); ... > which character set he wants to use at any time. ... > be shown on the first row of the new 3 button selection because I ... > first selection. ...
    (comp.lang.pascal.delphi.misc)