Link to home
Start Free TrialLog in
Avatar of smurfer69
smurfer69Flag for United States of America

asked on

query to add zeros to a number

I have a list of ID numbers, what I need to do is add zeros to the front of the number for every number that is less than 8 digits.  for example 123456 should be 00123456
Avatar of JestersGrind
JestersGrind
Flag of United States of America image

Convert it to a string.  Concatenate 7 zeros on to the left of the string.  Trim the string to only use the right 8 characters.

Greg
Avatar of Sean Stuber
Sean Stuber

right('00000000' + your_number,8)
In Your query

Format (yourfield, "00000000")
ASKER CERTIFIED SOLUTION
Avatar of IrogSinta
IrogSinta
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ha, that's even nicer  :)