Confusion re Formula! Please help

  • Thread starter Thread starter Ian D.
  • Start date Start date
I

Ian D.

In the Sample database that comes with Access there is a OrdersSubform with
a calculated field as follows

ExtendedPrice: CCur([Order
Details].[UnitPrice]*[Quantity]*(1-[Discount])/100)*100

It Obviously works but I'm not sure I understand the logic of the last half
of this formula.
Being that the "Discount" Filed is formatted as Percent,
could someone explain the logic of the (1-[Discount])/100)*100
Specifically the "1-" part.
I have to explain it to a user and I have no idea how. Even though it works.

Thanks for any insight.
 
The best I can figure is that if the discount is 20%
(.20), then you'd be paying 80% of the price (1-(20%)).

The part where they divide by 100 just to multiply by
100, I'm not sure I get, but the other part makes sense.

Does that help?
Emma
 
Thanks to both of you for the Explanation.
And although I think i now understand,
I think I'll just tell my usres that "it works - Don't touch it"
Thanks guys.

SHIPP said:
Percentages are stored as follows.

10% or .1000 is stored as 10.00 in access.

Therefore 1-(10.00/100)*100

1-(.1)*100

.9 * 100

90.00

90.00 is the way the number is stored in access. However, in reality it is
a percentage and therefore is .9000
--
M. Shipp


Ian D. said:
In the Sample database that comes with Access there is a OrdersSubform with
a calculated field as follows

ExtendedPrice: CCur([Order
Details].[UnitPrice]*[Quantity]*(1-[Discount])/100)*100

It Obviously works but I'm not sure I understand the logic of the last half
of this formula.
Being that the "Discount" Filed is formatted as Percent,
could someone explain the logic of the (1-[Discount])/100)*100
Specifically the "1-" part.
I have to explain it to a user and I have no idea how. Even though it works.

Thanks for any insight.
 
Back
Top