PC Review


Reply
Thread Tools Rate Thread

Change filed from scientific to fixed format

 
 
Bill-41
Guest
Posts: n/a
 
      24th Feb 2009
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!!
 
Reply With Quote
 
 
 
 
egerds
Guest
Posts: n/a
 
      24th Feb 2009
cdbl()
 
Reply With Quote
 
John Spencer
Guest
Posts: n/a
 
      24th Feb 2009
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
'====================================================


Bill-41 wrote:
> 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!!

 
Reply With Quote
 
Bill-41
Guest
Posts: n/a
 
      24th Feb 2009
Hi, Is there a way to change the properties of the field in the table to
fixed, zero decimals??


"John Spencer" wrote:

> 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
> '====================================================
>
>
> Bill-41 wrote:
> > 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!!

>

 
Reply With Quote
 
dymondjack
Guest
Posts: n/a
 
      24th Feb 2009
> > 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


"Bill-41" wrote:

> Hi, Is there a way to change the properties of the field in the table to
> fixed, zero decimals??
>
>
> "John Spencer" wrote:
>
> > 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
> > '====================================================
> >
> >
> > Bill-41 wrote:
> > > 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!!

> >

 
Reply With Quote
 
egerds
Guest
Posts: n/a
 
      24th Feb 2009
I picked cdbl b/c 2.34010825002E+11 exceeds integer
 
Reply With Quote
 
Jim Burke in Novi
Guest
Posts: n/a
 
      24th Feb 2009
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).

"Bill-41" wrote:

> 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!!

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      25th Feb 2009
On Tue, 24 Feb 2009 12:01:00 -0800, Bill-41 <(E-Mail Removed)>
wrote:

>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!"
--

John W. Vinson [MVP]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pasted numbers always in scientific format - despite cell format Putty Microsoft Excel Misc 0 30th Apr 2007 06:26 PM
Pasted numbers always in scientific format - despite cell format Putty Microsoft Excel New Users 0 30th Apr 2007 01:53 PM
union query and new filed with fixed value gip500 Microsoft Access Queries 2 14th Aug 2004 10:47 AM
change scientific format of numbers gigi Microsoft Excel Charting 3 29th Apr 2004 01:03 AM
Re: Help Format Filed Steven Microsoft Dot NET Framework Forms 0 2nd Jul 2003 09:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:29 PM.