Query to return number before letters

Mark0123

Registered User.
Local time
Yesterday, 19:25
Joined
Feb 13, 2015
Messages
10
Hi all,

I would like to run a query which takes a code which contains a mixture of number and letter and returns all the number before the first letter. I was using the left function (=Left(([Codes],2)) but sometimes there is one number sometime two. The desired results are shown below;

7pol2try36 = 7
12cet9fre55 = 12
10yea3gtr77 = 10

Is this possible?

Thank you in advance.
Mark
 
Try the Val Function.
Code:
? Val("7pol2try36")
 7 
? Val("12cet9fre55")
 12 
? Val("10yea3gtr77")
 10
 
Thank you

It works until it encounters an E followed by a number in the code. It then adds zeros depending on the number after the E. For example;

10E3 = 10000
12E1 = 120
9E5 = 900000

Any thoughts?
 
I added the replace function. So problem solved. Thank you all

Mark
 

Users who are viewing this thread

Back
Top Bottom