A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Auto fill in missing digits



 
 
Thread Tools Display Modes
  #1  
Old August 27th, 2009, 02:48 AM posted to microsoft.public.access.tablesdbdesign
txlogic
external usenet poster
 
Posts: 3
Default Auto fill in missing digits

I have a file I am importing into a table and if the number begins with one
or two 0's they are missing from the data in the new table. How can i set up
the formatt on the table so the numbers are a set length and if not, it will
automatically fill in the missing 0's?
  #2  
Old August 27th, 2009, 04:18 AM posted to microsoft.public.access.tablesdbdesign
Piet Linden[_2_]
external usenet poster
 
Posts: 280
Default Auto fill in missing digits

On Aug 26, 8:48*pm, txlogic wrote:
I have a file I am importing into a table and if the number begins with one
or two 0's they are missing from the data in the new table. *How can i set up
the formatt on the table so the numbers are a set length and if not, it will
automatically fill in the missing 0's?


What is the data type of this field? If it's numeric, then you can't
keep the leading zeros. If it's not a field that you do math on, it
should probably be a text field anyway.

You can use Format$() to do this.
  #3  
Old August 27th, 2009, 05:38 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Auto fill in missing digits

On Wed, 26 Aug 2009 18:48:03 -0700, txlogic
wrote:

I have a file I am importing into a table and if the number begins with one
or two 0's they are missing from the data in the new table. How can i set up
the formatt on the table so the numbers are a set length and if not, it will
automatically fill in the missing 0's?


Use a Text field, not any sort of number. As numbers, 31 and 031 and
0000000000031 are just three different ways of depicting *exactly the same
number*.

--

John W. Vinson [MVP]
  #4  
Old August 27th, 2009, 03:21 PM posted to microsoft.public.access.tablesdbdesign
Steve[_77_]
external usenet poster
 
Posts: 1,017
Default Auto fill in missing digits

For clarification, it is wrong to refer to 031 and 0000000000031 as numbers.
There are absolutely no numers that look like 031 and 0000000000031. Both
031 and 0000000000031 are character strings and therefore text data type.
You are one-hundred percent correct in saying "Use a Text field".

Steve


"John W. Vinson" wrote in message
...
On Wed, 26 Aug 2009 18:48:03 -0700, txlogic
wrote:

I have a file I am importing into a table and if the number begins with
one
or two 0's they are missing from the data in the new table. How can i set
up
the formatt on the table so the numbers are a set length and if not, it
will
automatically fill in the missing 0's?


Use a Text field, not any sort of number. As numbers, 31 and 031 and
0000000000031 are just three different ways of depicting *exactly the same
number*.

--

John W. Vinson [MVP]



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:25 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.