Multiplication Question

  • Thread starter Thread starter Maurita
  • Start date Start date
M

Maurita

Hi, I am having a problem with a multiplication question. I have a
textbox, Text67, where I need to have a calculation from two other
fields display, but not be saved in the table. The formula I need to
create is (Crew Size * 8) / Standard Rate. The problem involves
multiplying by "8". When I create the formula in the unbound text box,
" =[CrewSize]/[StandardRate] ", the expression works fine. If I try to
incorporate the *8 function, it never works, no matter how many ways
I've tried.

Could someone please give me an idea of how to make the expression "
(Crew Size * 8) / Standard Rate " work in an unbound text box.

Thank you.

Maurita
 
Damian,

Thank you so very much, it works GREAT! My formula started out the way
yours does, but I didn't have the parenthesis in the proper place.
Again, thank you.
Damian said:
Hi Maurita...

=([Crew Size]*8)/[Standard Rate]

Damian.

Maurita said:
Hi, I am having a problem with a multiplication question. I have a
textbox, Text67, where I need to have a calculation from two other
fields display, but not be saved in the table. The formula I need to
create is (Crew Size * 8) / Standard Rate. The problem involves
multiplying by "8". When I create the formula in the unbound text box,
" =[CrewSize]/[StandardRate] ", the expression works fine. If I try to
incorporate the *8 function, it never works, no matter how many ways
I've tried.

Could someone please give me an idea of how to make the expression "
(Crew Size * 8) / Standard Rate " work in an unbound text box.

Thank you.

Maurita
 
Damian,

I have another quick question. This formula returns a decimal, which
is what I was looking for. But, I need the decimal to be rounded to 6
places to the right of the decimal point. Can you give me an idea what
I need to do to accomplish this. Thank you.

Maurita
Damian,

Thank you so very much, it works GREAT! My formula started out the way
yours does, but I didn't have the parenthesis in the proper place.
Again, thank you.
Damian said:
Hi Maurita...

=([Crew Size]*8)/[Standard Rate]

Damian.

Maurita said:
Hi, I am having a problem with a multiplication question. I have a
textbox, Text67, where I need to have a calculation from two other
fields display, but not be saved in the table. The formula I need to
create is (Crew Size * 8) / Standard Rate. The problem involves
multiplying by "8". When I create the formula in the unbound text box,
" =[CrewSize]/[StandardRate] ", the expression works fine. If I try to
incorporate the *8 function, it never works, no matter how many ways
I've tried.

Could someone please give me an idea of how to make the expression "
(Crew Size * 8) / Standard Rate " work in an unbound text box.

Thank you.

Maurita
 
Hi Maurita,

Enclose it in the "round" function...

=round(([Crew Size]*8)/[Standard Rate], 6)

Damian.

Maurita said:
Damian,

I have another quick question. This formula returns a decimal, which
is what I was looking for. But, I need the decimal to be rounded to 6
places to the right of the decimal point. Can you give me an idea what
I need to do to accomplish this. Thank you.

Maurita
Damian,

Thank you so very much, it works GREAT! My formula started out the way
yours does, but I didn't have the parenthesis in the proper place.
Again, thank you.
Damian said:
Hi Maurita...

=([Crew Size]*8)/[Standard Rate]

Damian.

:

Hi, I am having a problem with a multiplication question. I have a
textbox, Text67, where I need to have a calculation from two other
fields display, but not be saved in the table. The formula I need to
create is (Crew Size * 8) / Standard Rate. The problem involves
multiplying by "8". When I create the formula in the unbound text box,
" =[CrewSize]/[StandardRate] ", the expression works fine. If I try to
incorporate the *8 function, it never works, no matter how many ways
I've tried.

Could someone please give me an idea of how to make the expression "
(Crew Size * 8) / Standard Rate " work in an unbound text box.

Thank you.

Maurita
 
Damian,

Thank you so very much, you are great. The function works exactly like
I need. I thought I needed the "round" function, but was unsure how to
write the code for six spaces to the right of the decimal point. I've
learned a lot with your help. Thanks again.

Maurita

Damian said:
Hi Maurita,

Enclose it in the "round" function...

=round(([Crew Size]*8)/[Standard Rate], 6)

Damian.

Maurita said:
Damian,

I have another quick question. This formula returns a decimal, which
is what I was looking for. But, I need the decimal to be rounded to 6
places to the right of the decimal point. Can you give me an idea what
I need to do to accomplish this. Thank you.

Maurita
Damian,

Thank you so very much, it works GREAT! My formula started out the way
yours does, but I didn't have the parenthesis in the proper place.
Again, thank you.
Damian S wrote:
Hi Maurita...

=([Crew Size]*8)/[Standard Rate]

Damian.

:

Hi, I am having a problem with a multiplication question. I have a
textbox, Text67, where I need to have a calculation from two other
fields display, but not be saved in the table. The formula I need to
create is (Crew Size * 8) / Standard Rate. The problem involves
multiplying by "8". When I create the formula in the unbound text box,
" =[CrewSize]/[StandardRate] ", the expression works fine. If I try to
incorporate the *8 function, it never works, no matter how many ways
I've tried.

Could someone please give me an idea of how to make the expression "
(Crew Size * 8) / Standard Rate " work in an unbound text box.

Thank you.

Maurita
 
Maurita said:
Damian,

Thank you so very much, it works GREAT! My formula started out the way
yours does, but I didn't have the parenthesis in the proper place.
Again, thank you.
Damian S wrote:

You shouldn't need the parentheses at all. BASIC will do the multiplication
first
then the division.

Tom Lake
 
Tom said:
You shouldn't need the parentheses at all. BASIC will do the multiplication
first
then the division.

.... and for that matter, what does it matter? You are right, of course,
Tom. But the answer is the same, regardless of whether the
multiplication or division is done first anyway. They might as well put:
=8/[Standard Rate]*[Crew Size]
.... or whatever.

No, I think the key factor here was nothing to do with the parentheses.
I think it was the brackets around the field names, which are required
because of the spaces in the field names.
 
Steve said:
the answer is the same, regardless of whether the
multiplication or division is done first anyway. They might as well put:
=8/[Standard Rate]*[Crew Size]
... or whatever.

Got to watch the data types, though.

Dividing by an INTEGER coerces the result to a FLOAT e.g.

SELECT 8 AS [Crew Size], 50 AS [Standard Rate],
TYPENAME([Crew Size] * 8 / [Standard Rate])

returns 'Double'. So I prefer your approach where the integer constant
is divided by the Rate which is unlikely to be floating point in nature
given the column names.

Personally, I'd use:

[Crew Size] / [Standard Rate] / 0.125

because dividing by a DECIMAL coerces the result to a DECIMAL.

Jamie.

--
 
Back
Top