RK Posted March 20, 2009 Posted March 20, 2009 I need an efficient way to run calculations on multiple records in one table against corresponding multiple records in a second table. Let's see if I can explain. Table one has dated contracts for pieces of equipment. One piece of equipment can have multiple contracts: Equipment SN / Date Start / Rate / Date End. A second Table has the same equipment, a record date, and miles run. This table (2) can have multiple records for each single piece of equipment: Equipment SN / Date Run / Miles Run. What is the easiest way to evaluate table (2) Miles Run against information in table (1) whether equipment was on contract or not?
comment Posted March 20, 2009 Posted March 20, 2009 A relationship such as: Contracts::Equipment SN = Log::Equipment SN AND Contracts::Date Start ≤ Log::Date Run AND Contracts::Date End ≥ Log::Date Run will enable you to use the applicable Rate from Contracts in the Log table (assuming that's what you're looking for).
RK Posted March 21, 2009 Author Posted March 21, 2009 Perfect ! That's exactly what I was looking for. Many thanks.
Recommended Posts
This topic is 5725 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now