Data Conversion

  • Thread starter Thread starter Tony Ramirez
  • Start date Start date
T

Tony Ramirez

I have a field in a table that lists data as "7.50 Inches", "7.75 Inches"
etc..etc. I want to convert this data to numeric. How would I do this...just
the code...I would probably do this within a query. Thanks so much.
 
Try this --
Val([YourField])
Assumming all measurements are in inches and none are in feet, yards, rods,
etc.
 
wow - thought val looked REALLY intelligent until I tried Val("6.5
anything")

so then I didn't bother trying val("6.5 inches") > val("6.5 Cms")

but I'd never have thought it would have coped with any text other than
numeric

so good piece of info Karl!

Jim Bunton

KARL DEWEY said:
Try this --
Val([YourField])
Assumming all measurements are in inches and none are in feet, yards,
rods,
etc.
--
KARL DEWEY
Build a little - Test a little


Tony Ramirez said:
I have a field in a table that lists data as "7.50 Inches", "7.75 Inches"
etc..etc. I want to convert this data to numeric. How would I do
this...just
the code...I would probably do this within a query. Thanks so much.
 
wow - thought val looked REALLY intelligent until I tried Val("6.5
anything")

so then I didn't bother trying val("6.5 inches") > val("6.5 Cms")

but I'd never have thought it would have coped with any text other than
numeric

Well, it does have some limits: Val("About 5.5 inches") will return 0, since
it immediately gives up if it encounters text that cannot be interpreted as a
number. And Val("3E5ABC") will return 300000 rather than the 3 you might
expect.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top