Calculating between tables

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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
 
Back
Top