I am trying to do a report for oilfield jobs, using access 2007. My database is designed with a job information table and a job run table. Each job has at least one run. I have a query that asks for the job number and links the apropriate job information and the runs associated with it. My report will show this run data for the customer to see why a run was ended (failures or normal rig operation). The sample would loook similar to this:
Run, DD Failure, Begin Time, End Time, Total Time, and Down Time.
I was able to calculate the total time with this code =Int(DateDiff("n",[DDBeginDrilling],[DDEndDrilling])/60) & "h" & DateDiff("n",[DDBeginDrilling],[DDEndDrilling]) Mod 60 & "m"
However, I am not sure if I am even doing this down time the "right" way. We would like to tell the customer the amount of time it took between the end time of the current run to the begin time of the next run.
I think I need to do an IIF statement that states, If the DD failure is yes then down time should equal Begin time (from next run)-End time(from current run). I do not know how to tell the report the begin time is from the next run (this could just be a brain freeze on my end).
I am wondering if it is wise to put this calculation in the report or if i need to build a query.
Run, DD Failure, Begin Time, End Time, Total Time, and Down Time.
I was able to calculate the total time with this code =Int(DateDiff("n",[DDBeginDrilling],[DDEndDrilling])/60) & "h" & DateDiff("n",[DDBeginDrilling],[DDEndDrilling]) Mod 60 & "m"
However, I am not sure if I am even doing this down time the "right" way. We would like to tell the customer the amount of time it took between the end time of the current run to the begin time of the next run.
I think I need to do an IIF statement that states, If the DD failure is yes then down time should equal Begin time (from next run)-End time(from current run). I do not know how to tell the report the begin time is from the next run (this could just be a brain freeze on my end).
I am wondering if it is wise to put this calculation in the report or if i need to build a query.