Data field

IanT

Registered User.
Local time
Today, 20:44
Joined
Nov 30, 2001
Messages
191
I have a field which will contain 10kg, 500g, 1ltr etc, how can I get code to ignore the abbreviations and us the numbers!
 
Parse each character in the field using the mid$ function checking each character with the IsNumeric function. The first False value -1 gives the length of the numeric portion of your string.
 
You can also use the Val() function to return the numeric portion, e.g:

? val("500g")
500

HTH - Bob
 

Users who are viewing this thread

Back
Top Bottom