String to number

  • Thread starter Thread starter Jeff Klein
  • Start date Start date
J

Jeff Klein

I have created a column in my query that extracts a number from another
field that is a string. I need to convert my new field to be a number so I
can sort properly. Any suggestions??
 
I have created a column in my query that extracts a number from another
field that is a string. I need to convert my new field to be a number so I
can sort properly. Any suggestions??

Val([fieldname])

will extract the first numeric substring of the information in fieldname as a
Number: e.g. Val("123") = 123, Val("0512ABC") is 512, Val("XY333") is 0
(because there's no initial number).

John W. Vinson [MVP]
 

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