Truncating data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I imported a table into Access and it is truncating my numbers field. Field
one has four zeros and a 1 (00001). When I transfered the data over, the
only thing that came across is 1. How do I get the zeros back?
 
a numeric value never has leading zeros. if your data is importing as a
Number data type, Access will ignore leading zeros and store the number. you
can set the Format property of the field in the table to

00000

to cause Access to *display* the value as 00001, but the stored value will
remain as 1.

if you need to include the leading zeros in the stored value, you'll need to
set the field's data type as Text. bear in mind that number characters
stored in a text field are treated as text, not as numbers.

hth
 
rjsrph said:
I imported a table into Access and it is truncating my numbers field. Field
one has four zeros and a 1 (00001). When I transfered the data over, the
only thing that came across is 1. How do I get the zeros back?

Yo add to Tina's excellent comments let me point out that it is not uncommon
to format or display numbers as text. The currency field does this
automatically. If you simply add formatting to a numeric field, you can
display it as 00001. In a query, add a column that looks like this:

NewField: Format([OldField], "00000")

where NewField is the name of an alias column you want to display and
OldField is the name of the column that contains your number 1.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Thanks guys!

Arvin Meyer said:
rjsrph said:
I imported a table into Access and it is truncating my numbers field. Field
one has four zeros and a 1 (00001). When I transfered the data over, the
only thing that came across is 1. How do I get the zeros back?

Yo add to Tina's excellent comments let me point out that it is not uncommon
to format or display numbers as text. The currency field does this
automatically. If you simply add formatting to a numeric field, you can
display it as 00001. In a query, add a column that looks like this:

NewField: Format([OldField], "00000")

where NewField is the name of an alias column you want to display and
OldField is the name of the column that contains your number 1.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top