Suppose I have a table...
Calibrations:
- Date
- CalibrationFactor
and another table...
Readings:
- Date
- Reading
Readings are made regularly... calibrations (which don't alter subsequent readings, but just figure out how much the readings are off at the time of the calibration) happen infrequently. So, at any given time, a reading needs to be corrected by whatever the most-recent CalibrationFactor is. I don't need this correction to be done by the SELECT statement; I just want them in the same row.
So, I'd like some SELECT which will give me: Readings.Date, Readings.Reading, Calibrations.CalibrationFactor where the CalibrationFactor is the latest one which is still earlier than Readings.Date. I've looked at some of the previous questions, here, but the closest I've found is one which would only find the latest calibration, period (SQL join: selecting the last records in a one-to-many relationship)
Ideas?