Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force leading zeros in front of a number 2

Status
Not open for further replies.

tdrBates

MIS
Nov 22, 2002
60
US
How can we force a number to always be 4 digits in length?
We're trying to pad a number with leading zeros. Is there a function in MS Access that can do this?

Example: "0008" or "0011"

Thanks
 
in the format property for the field....put four 0000's. Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III, MCP, Network+, A+
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Hi!

Robert's way is easiest but the function in Access to do this is Format(yournumber, "0000")

hth
Jeff Bridgham
bridgham@purdue.edu
 
thanks jebry....forgot to mention that! Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III, MCP, Network+, A+
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Hi Robert!

Well, if I deserved a star for my post, yours is certainly worthy as well!

:)
Jeff Bridgham
bridgham@purdue.edu
 
jebry,
of course you deserved the star...you provided a good, simple solution to the poster's question....and by giving you the star, someone else will hopefully find the post and use it for their question.... Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III, MCP, Network+, A+
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top