Need help creating a union query that merges two excel tables

ranopano

New Member
Joined
Dec 12, 2015
Messages
13
Hello,
I have 2 tables: a Loss Run containing injury information at each store and a list of monthly store hours.
I need to merge both these tables into 1, so that I can export it into excel and create a dashboard (using excel 2010).

I'm having a hell of a time figuring out how to do this.

Store hours are sent accumulated on a monthly basis. For instance, for this last month, store 1 might say 5/1/2016 = 2777 hours. This is a sum of all of May's hours, not the specific date.
Secondly, each store may have more than 1 injury per day. For instance, store 1 may have 2 or more injuries on 5/1/16, and I need specific injury information for each injury, so each injury will need it's own row.

The problem I am running into is either hours or injuries are being duplicated as seen below:
StoreDateHoursInjuriesInjury Type
11/1/201220000
12/1/201225001Strain
12/1/201225001Laceration
13/1/201223000
14/1/201225001Contusion
15/1/201223000
16/1/201226001Sprain

<tbody>
</tbody>


I am not very good with Access or SQL and am not too sure on how to do a Union Query correctly.
Can someone please assist?

I am able to send you the excel workbook containing these tables. I'm not sure how to attach documents directly on this site...
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
People use drop boxes to provide files in this forum. They don't allow file attachments for some reason.
I don't see the problem - it looks exactly like it should. For February, store 1, which had 2500 hours, had 1 strain and 1 laceration - what's wrong with that?
Union queries take columnar data and assemble it it rows, which is what you have anyway. Perhaps you should provide an example of what you want, rather than just what you get. Maybe you want a Crosstab query?
 
Upvote 0
You do need to give a better description. At first it sounds like you want some kind of sum per store. But then you say you need specific injury information. That's two separate things that cannot be combined, since a sum by store is by definition not specific to injuries but a sum of all injuries.
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,603
Members
449,038
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top