How can a querie make a record in a table

D

Dave

I am trying to get a querie from one table add a record to a different table.
Example:
Mileage table querie has a function that calculates total miles. I want to
take the date and total miles and add that to the expense table. How do I do
it? In the mileage table it only has the beginning and ending odometer
readings. The querie gives the total miles. It is hard to describe but if you
are good with queries: H E L P !!!
 
J

Jeff Boyce

Dave

Let's see if I understand your situation...

You have a table that holds a field containing a date (or date/time), and
that table holds a mileage value.

If this is accurate (if incomplete), you DON'T need to calculate and store
the total mileage per date. Not only does this waste disk storage space and
time, it potentially compromises the integrity of your data. You would then
also need to create (and run) a "synchronization" routine every time one of
the values changed ... what if someone fixes a mistake?!

The preferred approach to having a "total mileage by date" to look at is to
use a Totals query to derive that from the original detail data. "GroupBy"
the date field, "Sum" the mileage field.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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