Remove leading zeroes from records in a table. (text field)

RHONDAK72

Board Regular
Joined
Dec 26, 2007
Messages
133
Hello. I use Access 2010. I have a set of records where some values begin with leading zeroes while other values begin with a letter. Can anyone tell me how to remove only the leading zeroes from the records in the table?

Below is an example set of records with Before and then After(what I need for them to become)

BEFORE – This is the data that I pull:

Main.PRID
000123456
000789011
000121314
N00123456
N00123457

AFTER -This is what I want:

Main.PRID
123456
789011
121314
N00123456
N00123457
 
Supposing there are 3 zeros at the front, you could run an update query:
Code:
UPDATE main SET main.prid = Mid([prid],4)
WHERE (((main.prid) Like "000*"));
Meaning replace string beginning with 3 zero by the same string starting at character 4
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top