Decimal

N

NDNobbs

MFG Hours field is [MFG Supv Labor]/115.
MFG Hours Paid field is total [MFG Hours]*115.

I need to be able to enter the MFG Supv Labor dollar amount and get the
equivalent in MFG Hours. I should then be able to enter that same number of
hours to get the equivalent in dollars. That would give me a zero balance.

Expressions are not my forte. I'm an amateur here. Please help! Thanks
 
C

Clifford Bass

Hi,

I see nothing wrong with your formulae. Where/how are you trying to
use them and what issues are you running into? A query? Form? Report? VBA
Code?

Clifford Bass
 
N

NDNobbs

The problem seems to be the numbers. For example; (MFG Supv Labor)/115 could
be $12,456/115 = 108 MFG Hours (rounded). But once the quote is paid, I
enter MFG Hours Paid of 108 I get .... 108*115 = $12,420. I can't get the
dollars to give me a zero balance when paid.
--
NDNobbs


Clifford Bass said:
Hi,

I see nothing wrong with your formulae. Where/how are you trying to
use them and what issues are you running into? A query? Form? Report? VBA
Code?

Clifford Bass

NDNobbs said:
MFG Hours field is [MFG Supv Labor]/115.
MFG Hours Paid field is total [MFG Hours]*115.

I need to be able to enter the MFG Supv Labor dollar amount and get the
equivalent in MFG Hours. I should then be able to enter that same number of
hours to get the equivalent in dollars. That would give me a zero balance.

Expressions are not my forte. I'm an amateur here. Please help! Thanks
 
C

Clifford Bass

Hi,

Do you only pay by the whole number of hours? If so, you are stuck
with a discrepancy. Otherwise, it would make sense to round and store the
hours to some decimal place using a single, double or decimal field. Maybe
two or four places? If you only pay by the whole hours, you may want to add
some special logic to the balance computation. If hours billed = hours paid,
then balance is zero, otherwise it is some other computation.

Clifford Bass
 
N

NDNobbs

We do whole numbers for hours but the 'if hours billed = hours paid, then
balance is 0" makes perfect sense, but how would I write that?

Currently the balance is MFG Supv Labor-MFG Hours Paid, so I want the
balance to show until it's paid. Basically would it be something like this in
the query?
MFG Balance: ([MFG Supv Labor]-[MFG Hours Paid]) or If([MFG Hours]=[MFG
Hours Pd]=0) ???

Thank you!
 
C

Clifford Bass

Hi,

You are close. Try:

MFG Balance: IIf([MFG Hours]=[MFG Hours Pd], 0, [MFG Supv Labor]-[MFG Hours
Paid])

Clifford Bass
 
N

NDNobbs

Thank you, Clifford. I tried the formula and it did not give me the
information I needed. Is there a way to have the MFG Hours round down to the
nearest whole number regardless of the decimals? Should this be an If / Then
expression?
--
NDNobbs


Clifford Bass said:
Hi,

You are close. Try:

MFG Balance: IIf([MFG Hours]=[MFG Hours Pd], 0, [MFG Supv Labor]-[MFG Hours
Paid])

Clifford Bass

NDNobbs said:
We do whole numbers for hours but the 'if hours billed = hours paid, then
balance is 0" makes perfect sense, but how would I write that?

Currently the balance is MFG Supv Labor-MFG Hours Paid, so I want the
balance to show until it's paid. Basically would it be something like this in
the query?
MFG Balance: ([MFG Supv Labor]-[MFG Hours Paid]) or If([MFG Hours]=[MFG
Hours Pd]=0) ???

Thank you!
 
C

Clifford Bass

Hi,

So the MFG Hours is a decimal number? If so, then try:

MFG Balance: IIf(Int([MFG Hours])=[MFG Hours Pd], 0, [MFG Supv Labor]-[MFG
Hours
Paid])

Clifford Bass

NDNobbs said:
Thank you, Clifford. I tried the formula and it did not give me the
information I needed. Is there a way to have the MFG Hours round down to the
nearest whole number regardless of the decimals? Should this be an If / Then
expression?
--
NDNobbs


Clifford Bass said:
Hi,

You are close. Try:

MFG Balance: IIf([MFG Hours]=[MFG Hours Pd], 0, [MFG Supv Labor]-[MFG Hours
Paid])

Clifford Bass

NDNobbs said:
We do whole numbers for hours but the 'if hours billed = hours paid, then
balance is 0" makes perfect sense, but how would I write that?

Currently the balance is MFG Supv Labor-MFG Hours Paid, so I want the
balance to show until it's paid. Basically would it be something like this in
the query?
MFG Balance: ([MFG Supv Labor]-[MFG Hours Paid]) or If([MFG Hours]=[MFG
Hours Pd]=0) ???

Thank you!
 
J

John W. Vinson

Is there a way to have the MFG Hours round down to the
nearest whole number regardless of the decimals?

A couple of ways; the \ operator (backslash) is an "integer divide" which
rounds down: e.g. 7/4 = 1.75 but 7\4 = 1. Or you can use the Fix() function:
Fix(1.75) = 1.
 

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