I need to spot occurrences where the sum of the detail records in group level 2 exceeds a value AND if the difference between successive group level 2's is less than 1.0 . I think the only way I will achieve this without a multitude of complex queries is with a report. I envision a report where group level 1 is Empl_ID and group 2 is Shift_Start (as dd/mm/yyyy HH:MM:SS PM). The detail records will be hours worked. I can use conditional formatting to flag the occurrences of TOTAL that exceed a value. However, I don't know how to approach the second part. If I put a control for date/time in the group header or footer, can I compare B minus A, C minus B, but not C minus A? Or would I need to link a function to the control where it subtracts n-1 from n (e.g. 7-6) assuming each level two header or footer has an index (n) property? I'm only guessing that a function or expression would be able to calculate since the latter group would load after the one whose value it will be trying to subtract. I have already tried to achieve the result in Excel with formulas, but don't see a way out. The aim is for the output to require as little manual manipulation as possible. The table below is my attempt to present a visual of the desired result in as small a space as possible; I realize it is not how the report layout would look, nor would the date/time have to be repeated on each row if it can go into the group header. Ideally, I would be able to add the values where the difference is less than 24 hours, but that might be a bit much to ask for. Thanks for any consideration!
EMPL_ID this is group level one 12345 SHIFT_START 11/22/2014 6:30:00 PM 2 this is group level two 11/22/2014 6:30:00 PM 2 11/22/2014 6:30:00 PM 8 TOTAL 18 11/23/2014 6:30:00 PM 2 diff between this and previous 11/23/2014 6:30:00 PM 6 group level is >= 1 (24 hrs) 11/23/2014 6:30:00 PM 10 so OK, no flag TOTAL 18 11/24/2014 6:30:00 AM 6 diff between this and previous 11/24/2014 6:30:00 AM 6 group level is < 24 hrs. 11/24/2014 6:30:00 AM 6 so FLAG TOTAL 18