Calculation

P

PennyB

I need to calculate a value from one of my fields to be stored in another
field.

The first field is called [Valuation] the second field is [GreenFee].

The Green Fee is calculated off the valuation as follows:

For every $25,000 or fraction there of there would be a fee of $1.00.

So if you have a valuation of $5.00 the fee is $1.00

If you have a valuation of $25,000 the fee is $1.00

25,001 it would be $2.00

and so on.

How can I calculate this with the fraction there of?
 
J

Jeff Boyce

Penny

It is rarely necessary to store a calculated value. If you can calculate
it, in many cases, you're better off using a query to (re-)calculate it as
needed. There are exceptions, but you'd need to describe your situation in
more detail to tell if it's one of them.

It sounds like you are saying that the fee is $1.00 per $25,000 of
valuation.

If you knew how many times 25000 divided into the valuation, that's how many
dollars, plus 1. Take a look at the MOD function in Access HELP. Or,
alternatively, take a look at "integer division" ... you'll still need to
add 1.

As an example, if you had 55,000 in valuation, 25000 divides into that
twice. Add one & get 3 - $3 is right, right?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
F

fredg

I need to calculate a value from one of my fields to be stored in another
field.

The first field is called [Valuation] the second field is [GreenFee].

The Green Fee is calculated off the valuation as follows:

For every $25,000 or fraction there of there would be a fee of $1.00.

So if you have a valuation of $5.00 the fee is $1.00

If you have a valuation of $25,000 the fee is $1.00

25,001 it would be $2.00

and so on.

How can I calculate this with the fraction there of?

What do you intend to do when, in the future, the $1 per valueation
fee is raised?

GreenFee = [Valuation]\25*1+IIf([Valuation]\25<>[Valuation]/25,1,0)

Note that I the above expression uses the Division symbol (/) as well
as the Integer Division symbol (\). Write the expression using those
2 symbols exactly as I have..

The *1 is not really necessary here as any number times 1 is that same
number.
I've left it in just in case you change the fees in the future. You
really should have the fee value stored in a table for easy changing.
In that case change the above expression to perhaps something like:
=[Valuation\25 * [Rate] + etc....<> [Valuation]/25,[Rate],0)

There is absolutely no need to store the Green Fee value in any table.
Any time you need to know what the green fee is, recalculate it, in a
query, on a form, or in a report.
 

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