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

Leading 0's in number field

Status
Not open for further replies.

bill1one

Programmer
Sep 29, 2004
93
US
I have an ID field in my table and 0's are crucial in the ID. Many IDs start with a 0, such as 0120743. Whnever I enter an ID, the leading 0's disappear, so 0120743 becomes 120743. Is there a way to stop that from happening?
 
You have to use a text field to store numbers with leading zeros.
 
If you are not using any calculation with this number then you can set the DataType = Text in the table design.

________________________________________________________
Zameer Abdulla
Help to find Missing people
There’s a world of difference between editorials and advertorials
 
I am too late on reaching you.. Sorry

________________________________________________________
Zameer Abdulla
Help to find Missing people
There’s a world of difference between editorials and advertorials
 
bill1one said:
That's no fun.

standard rule of thumb is: if you aren't going to perform calculations then don't store it as a number, make it text.

How often do you add up all the SSN in your tables? Or ZipCodes? Are you going to be performing calculations on these ID numbers?

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top