Rounding issue

  • Thread starter RedHeadedMonster via AccessMonster.com
  • Start date
R

RedHeadedMonster via AccessMonster.com

I have two queries that are basically identical. Except for one thing. Both
queries are looking at prices for parts.

One is being used to create a pricing chart on the fly, i.e., the user can
tell it whether it wants 2008 or 2009 prices. So that they can see the
difference in pricing. Prices for parts are being updated constantly
depending on when pricing agreements end.

The second is static, in that it is "locked in" for prices for 2008
specifically. Because it is the official "contract" pricing chart. Once you
give a customer a bid on prices, you can't change them - except for special
cases. So bascially you lock in their contract prices for the 2008 time
period.

If I run the queires on identical sets of data I get small rounding
differences.

In the query that is changing prices on the fly depending on the year the
user uses I use the following formula:

PB is a procurement burden that is a percentage (1.75%) that contracts adds
onto a cost.

PB1: Round([CostEach1]*[Forms]![DaBOM]![Param].[Form]![PB],2)

In the static one the formula is:

PB1: Round([CostEach1]*0.0175,2)

If the cost is $150
Formula 1 gives a PB of $2.63
Formula 2 gives a PB of $2.62

What am I doing wrong?

It may seem like a trivial problem, but when we are talking about over 600
parts, it adds up.
Thanx!
RHM
 
J

Jeff Boyce

It all starts with the data ...

What are the underlying datatypes for the fields you're using in the
calculations?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
R

RedHeadedMonster via AccessMonster.com

PB is stored as a Number, Double
Cost is stored as Currency

RHM

Jeff said:
It all starts with the data ...

What are the underlying datatypes for the fields you're using in the
calculations?

Regards

Jeff Boyce
Microsoft Office/Access MVP
I have two queries that are basically identical. Except for one thing.
Both
[quoted text clipped - 39 lines]
Thanx!
RHM
 
J

Jeff Boyce

"Double" numbers are stored in binary form, and may not be "exact" matches
for the decimal number that was entered.

If your PB is never more that 4 decimal places, try using Currency datatypes
all 'round.

Regards

Jeff Boyce
Microsoft Office/Access MVP

RedHeadedMonster via AccessMonster.com said:
PB is stored as a Number, Double
Cost is stored as Currency

RHM

Jeff said:
It all starts with the data ...

What are the underlying datatypes for the fields you're using in the
calculations?

Regards

Jeff Boyce
Microsoft Office/Access MVP
I have two queries that are basically identical. Except for one thing.
Both
[quoted text clipped - 39 lines]
Thanx!
RHM
 

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