How do I put an equation in a column in a table?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two columns in a table - Miles and KM. I input the miles value in the
column but then I would like the KM column to automatically enter the
conversion using an equation. I am a complete novice with Access so a
step-by-step guide would be nice please. I'm pulling my hair out
 
MIPS,
You don't... Since you already have Miles captured, you wouldn't need to have a field
to hold the Kilometer equivalent.
You would just calculate Kilometers in any subsequent form, query, or report.

A popular example is Price * Qty = LineTotal
Since Price and Qty are captured, LineTotal is not saved to the table, it's
recalculated "on the fly" whenever needed.
A text control with a ControlSource of...
= [Price] * [Qty]
will always display the correct LineTotal.

= [Miles] * 1.06
would do the same for Miles to Kilometers.
 
Hi

You don't store the results of an equation in a table. You need to have a
field in your table called Miles then simply use a query or a form to give
the results you want

In a form create a new text box and use this as the control source
=[Miles]/1.609344

In a query use
Kiliometers: [TableName]![Miles]/1.609344

Hope this helps
 
both prior replies are absolutely correct; within the context of db design
norms one doesn't hold a calculated value....nonetheless - I know the real
world need to create tables for other reasons....use the MakeTable Query
feature to calculate the KM value and also create a table keeping it...if
this is what you truly need...
 
Hmm... shouldn't that be Miles * 1.06
1 Mile = 1.06 Kilometers
Al Campagna

Wayne-I-M said:
Hi

You don't store the results of an equation in a table. You need to have a
field in your table called Miles then simply use a query or a form to give
the results you want

In a form create a new text box and use this as the control source
=[Miles]/1.609344

In a query use
Kiliometers: [TableName]![Miles]/1.609344

Hope this helps

--
Wayne
Manchester, England.
Enjoy whatever it is you do


MIPS_1974 said:
I have two columns in a table - Miles and KM. I input the miles value in the
column but then I would like the KM column to automatically enter the
conversion using an equation. I am a complete novice with Access so a
step-by-step guide would be nice please. I'm pulling my hair out
 
Al said:
Hmm... shouldn't that be Miles * 1.06
1 Mile = 1.06 Kilometers
Al Campagna

Al,

Unit Equation

1 mile {5280 ft / mile} {12 in / ft} (2.54 cm / in} {1 m / 100 cm} {1 Km
/ 1000 m} = 1.609344 Km

Note that there are exactly 2.54 centimeters per inch so 1.609344 is not
an approximation.

You probably remembered 1.6, which became 1.60 and somehow transposed
the digits. Ease up on the coffee friend.

James A. Fortune
(e-mail address removed)
 
James,
Yes that was a typo, but I was mainly referring to Kilometers = Miles / 1.609
It should be Miles * 1.609
Al Campagna
 
Al said:
James,
Yes that was a typo, but I was mainly referring to Kilometers = Miles / 1.609
It should be Miles * 1.609
Al Campagna

Al,

Yes, that's correct.

miles * {1.609 Km/mile} = kilometers

Since a mile is longer than a kilometer, it's natural for someone to try
to make the number smaller rather than larger. I can't say I've never
made a similar mistake.

James A. Fortune
(e-mail address removed)
 

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

Back
Top