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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using zero's in numbers

Status
Not open for further replies.

Sylvialn

IS-IT--Management
Dec 28, 2000
101
US
I would like to use the values 001 & 02 in two of my assigned variables. I have the variables listed as integers and am trying to assign the values in Access' SQl. I have: firsttwo, nextthree as integers, and have firsttwo = "02" and nextthree = "001". Access will not allow me to use firsttwo = #02#. How do I assign these values where access will keep the zeros in the front? Once the variable is passed, it reads as firsttwo = 2, and I need firsttwo = 02.
 
using the Format() statement

Format(FirstTwo,"00")
Format(NextThree,"000")

PaulF
 
Just a Note:
If you are storing data in a table with leading zero's then you have to use a string data type not a number.

DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top