Re: Why character instead of numerics?
From: Cindy Winegarden (cindy_winegarden_at_msn.com)
Date: 09/15/04
- Previous message: Tom Edelbrok: "Why character instead of numerics?"
- In reply to: Tom Edelbrok: "Why character instead of numerics?"
- Next in thread: Tom Edelbrok: "Re: Why character instead of numerics?"
- Reply: Tom Edelbrok: "Re: Why character instead of numerics?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 14 Sep 2004 20:32:30 -0400
Hi Tom,
Please create some representative data -
Create Cursor Test (CharField C(15))
Insert Into Test Values ("AG548-CNN765-3")
* etc.
Then post the code you are using in your SQL and also the code for the
function you are calling.
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com www.cindywinegarden.com
"Tom Edelbrok" <anonymous@anonymous.com> wrote in message
news:NvJ1d.20305$KU5.4794@edtnps89...
> If is create a numeric field in a table and then browse the table (VFP
> 8.1)
> it shows up right-justified in the column and is understood by VFP to be a
> numeric (not numeric digits in a character string that looks like a
> number).
>
> However, if I decode a character string that is composed of various digits
> using string functions like leftc or rightc, I will end up with a shorter
> charcter string. For example, if I strip the '548' out of
> 'AG548-CNN765-3',
> the '548' is still a string rather than a numeric. So I use the VAL()
> function to change it to numeric, and the result goes into a cursor that I
> browse. BUT the final result is still a character string!!! What am I
> doing
> wrong?
>
> The numeric value (stripped out of the character string) is returned to me
> by a function I made, ie: 'function whatever(thesourcestring) as integer'.
> Yet it still gets returned as character (and shows up left justifed in the
> column when browsed). If I use the '?' symbol from the command window to
> display the VAL() of a numeric character string I get the correct result,
> ie: '? val('123')' yields a number.
>
> So what am I doing wrong? All I want is to get a numeric back from the
> string so that my 'inner join anothertable on thisnumber = thatnumber'
> will
> work.
>
> Thanks for help in advance,
>
> Tom Edelbrok
>
>
- Previous message: Tom Edelbrok: "Why character instead of numerics?"
- In reply to: Tom Edelbrok: "Why character instead of numerics?"
- Next in thread: Tom Edelbrok: "Re: Why character instead of numerics?"
- Reply: Tom Edelbrok: "Re: Why character instead of numerics?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|