Change filed from scientific to fixed format

B

Bill-41

Hi, I'm relatively new to this. I'm importing a CSV file into an access
table called finance. The field 'account' displays as 2.34010825002E+11 in
scientific format. I want to get it as a 12 digit fixed numberwith no
decimals. ie: 234010825002

Can someone please help put me on the right track to get some VBA code that
would change the filed properties?

Thanks!!
 
J

John Spencer

Cdbl will convert that a decimal based number.

Int will return just the integer portion. OR If you want to round the
number then you will need use the round function to round it up or down
as appropriate (round uses bankers rounding).

If you want leading zeroes you will need to convert the value to a
string and pad with leading zeroes.


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
B

Bill-41

Hi, Is there a way to change the properties of the field in the table to
fixed, zero decimals??
 
D

dymondjack

Int will return just the integer portion.

An Integer is a number with no decimals...

--
Jack Leach
www.tristatemachine.com

- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain
 
J

Jim Burke in Novi

You can define it as a decimal field with a scale of 0 (no digits to the
right of the decimal point) and set the precision to what you need it to be
(default is 18 places to the left of the decimal point).
 
J

John W. Vinson

Hi, I'm relatively new to this. I'm importing a CSV file into an access
table called finance. The field 'account' displays as 2.34010825002E+11 in
scientific format. I want to get it as a 12 digit fixed numberwith no
decimals. ie: 234010825002

Can someone please help put me on the right track to get some VBA code that
would change the filed properties?

Thanks!!

You actually don't want this in *any* sort of Number field - it won't fit in
an integer, and Double will risk roundoff error. Account numbers aren't used
for calculations, so they should be stored in a Text field.

If you're using an input specification, use a Text datatype for this field. If
not, put a "dummy" record in the first row with

ACCOUNTNUMBER

in the position of this field to whack Access upside the head saying "hey,
this is a text field!"
 
J

JimBurke

Missed that part completely. John's right - this should be a text field. No
reason for it to be stored as numeric.
Hi, I'm relatively new to this. I'm importing a CSV file into an access
table called finance. The field 'account' displays as 2.34010825002E+11 in
[quoted text clipped - 5 lines]

You actually don't want this in *any* sort of Number field - it won't fit in
an integer, and Double will risk roundoff error. Account numbers aren't used
for calculations, so they should be stored in a Text field.

If you're using an input specification, use a Text datatype for this field. If
not, put a "dummy" record in the first row with

ACCOUNTNUMBER

in the position of this field to whack Access upside the head saying "hey,
this is a text field!"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top