String to number

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??
 
J

John W. Vinson

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]
 
Top