Historical Shop Load Data

I have been asked to pull historical shop load data (IE: Est Hours Scheduled between X and Y). So I am looking at the EstSetHours and EstProdHours for all rows in JobOper with a StartDate between X and Y, and a OpCode of ‘MILL’. This returns all of the proper jobs, but the data is not accurate because some of the jobs start right at the end of time frame and roll into the next. So, if Job 123456 has 75 EstProdHours and is scheduled to start an hour before the time frame ends, the query will still return 75 hours.

Does anyone know if there is a different way to go about this, or if I am basically SOL. (I tried to delve deeper into the ShopLoad RDD, but most of it consists of Calculated fields, and I don’t believe there is a way to see what those magical calculations are)

Could you make a calculated field that is something like this pseudo code:

if StartDate + EstProdHours > Y_Date then
    return EstProdHours - (Y_Date - StartDate + EstProdHours)
else
    return EstProdHours