Bevos
asked on
Trim Leading 0s from percentage input mask
Hello, I have a column in an Access table saved as a text field with a percentage input mask 999\%;;_. Users have been entering data in this fashion 001 for 1%. Can I trim the leading 0s from this field in any way?
Thank you,
Bevo
Thank you,
Bevo
Make a backup first.
Example:
UPDATE Table1 SET Table1.YourField = Trim([YourField]);
mx
Example:
UPDATE Table1 SET Table1.YourField = Trim([YourField]);
mx
I don't think the trim function takes care of zeros.
Perhaps this:
iif(isnumeric([yourfield]) ,trim(cstr (cdec([You rfield]))) ,[YourFiel d])
Perhaps this:
iif(isnumeric([yourfield])
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yep, silly me numeric fixes everything quickly and easily
I agree...change the datatype to numeric. Even if you have to change it back to a string, that should clear the zeros. The only issue is if you have non-numeric data
Why work that hard?
UPDATE tblWhatever SET tblWhatever.PercentText = CInt([PercentText]);
The underlying field remains text.
CInt() or CLng() will whack leading zero.
My 2¢
UPDATE tblWhatever SET tblWhatever.PercentText = CInt([PercentText]);
The underlying field remains text.
CInt() or CLng() will whack leading zero.
My 2¢
mx