Calculating between tables

G

Guest

Hi,
I have three tables, Dead, Runs and Bus. Dead and Runs refer to the Bus
table for a Bus registration number.
In Runs and Dead I input start and finish values.
What I am trying to do, is calculate the Minimum and Maximum value for each
Bus from the entries in these two tables.

I know how to then calculate the total mileage for the difference.

Thanks

Steve A
 
G

Guest

What is your database setup including feild names and relationships?

tblBus
-------
BusID (PK)
other pertinent fields....

tblDead
---------
BusID (FK)
other pertinent fields...

tblRuns
--------
BusID (FK)
other pertinent fields....

I'm guessing, not really knowing your setup, that you could create a query
grouped on BusID that will pull the values you want to see.
 
G

Guest

Hi,
Yes, that is roughly how the tables are set up, but when I run a query it
just gives me one vehicle. I think it is the only one which has records in
both tables so far.
What I'm looking to do is take every reg which is recorded in the tblBus,
then find the minimum start value for this vehicle be it on the tblRuns or
tblDead, likewise maximum.

The various ways I've tried this have all failed. Any ideas?

Thanks
 

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