Please help me if you can.
I have two separate queries that give the following results.
QueryOne
EventCode, EventWkCode, SumOfwkHours
23062, PP, 89.5
23062, B, 141
23062, F, 47.5
QueryTwo
EventCode, EventWkCode, SumOfwkHours
23062, F_UST, 5
I need to subtract QueryTwo from from QueryOne. The number needs to subtract from Item reported as EventWkCode F in QueryOne. It would mean that 47.5 - 5 would equal 42.5.
The final results I would like to achieve is a report with the following
EventCode EventWkCode SumOfwkHours
23062, PP, 89.5
23062, B, 141
23062, F, 42.5
23062, F_Ust, 5
I can use a union query to put the two items together but in the record set I am pulling this information from F and F_UST are the same. QueryTwo separate them using different criteria and adds the F_UST to EventWkCode. If I don’t subtract this amount then my total would be off by 5 hours. I have racked my brain to figure this problem out but I am drawing a blank. Any help will be appreciated.
I have two separate queries that give the following results.
QueryOne
EventCode, EventWkCode, SumOfwkHours
23062, PP, 89.5
23062, B, 141
23062, F, 47.5
QueryTwo
EventCode, EventWkCode, SumOfwkHours
23062, F_UST, 5
I need to subtract QueryTwo from from QueryOne. The number needs to subtract from Item reported as EventWkCode F in QueryOne. It would mean that 47.5 - 5 would equal 42.5.
The final results I would like to achieve is a report with the following
EventCode EventWkCode SumOfwkHours
23062, PP, 89.5
23062, B, 141
23062, F, 42.5
23062, F_Ust, 5
I can use a union query to put the two items together but in the record set I am pulling this information from F and F_UST are the same. QueryTwo separate them using different criteria and adds the F_UST to EventWkCode. If I don’t subtract this amount then my total would be off by 5 hours. I have racked my brain to figure this problem out but I am drawing a blank. Any help will be appreciated.
Last edited: