fractional part of value returns multiple digits

B

Bill.Carlson

Access 2007

We have imported data (through copy and paste append) from another
application into an Access table and we are struggling with
maintaining a value with only 2 decimals as this value is later used
in excel vlookup functions.

In my simple query, I have tried Round([ValueField],2) -- the query
still returns values such as 115.01000213623 for any data element that
is not a whole number.

How may I return a value of just 115.01 in the above example -- we
need the result to be a number and not text.

As always, help is much appreciated,

Bill Carlson
 
M

Marshall Barton

Bill.Carlson said:
Access 2007

We have imported data (through copy and paste append) from another
application into an Access table and we are struggling with
maintaining a value with only 2 decimals as this value is later used
in excel vlookup functions.

In my simple query, I have tried Round([ValueField],2) -- the query
still returns values such as 115.01000213623 for any data element that
is not a whole number.

How may I return a value of just 115.01 in the above example -- we
need the result to be a number and not text.


Make the field in its table a Currency field instead of
Double. If necessary, Round should then be able to polish
it up.
 
J

Jerry Whittle

If up to 4 decimal places is acceptable, use the CCur function. It does do a
bit of rounding.

Another method which would truncate everything after the 2nd decimal point:

CLng([ValueField] * 100)/100
 
B

Bill.Carlson

If up to 4 decimal places is acceptable, use the CCur function.  It does do a
bit of rounding.

Another method which would truncate everything after the 2nd decimal point:

CLng([ValueField] * 100)/100
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.



Bill.Carlson said:
Access 2007
We have imported data (through copy and paste append) from another
application into an Access table and we are struggling with
maintaining a value with only 2 decimals as this value is later used
in excel vlookup functions.
In my simple query, I have tried Round([ValueField],2) -- the query
still returns values such as 115.01000213623 for any data element that
is not a whole number.
How may I return a value of just 115.01 in the above example -- we
need the result to be a number and not text.
As always, help is much appreciated,
Bill Carlson
.- Hide quoted text -

- Show quoted text -

Wonderful! -- Thank you Marshall, Jerry.
 

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