Calculating results by combining two tables in MSaccess

khandelwal

New Member
Joined
Dec 19, 2018
Messages
4
I want to draw a result based on data available in two different tables in the same database. Basically, I want to calculate the % share from both of these tables
My Table 1 looks like this and has data somewhat like this.
| Code | Category | |------|----------| | ABC | 123 | | BCD | 145 | | DEF | 0 | | ACF | 5 | | BCF | 1588 |
My Table 2 looks like this and has data somewhat like this.
| Code | Category | |------|----------| | ABC | 12301 | | BCD | 14502 | | DEF | 3255 | | ACF | 7049 | | BCF | 15234 |
I want to divide Table A result matching to Table 2 results in a single query. My outcome should look like this
| Code | % | |------|--------| | ABC | 1.00% | | BCD | 1.00% | | DEF | 0.00% | | ACF | 0.07% | | BCF | 10.42% |
Need help with a way to calculate the same in MSAccess.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
your table is not designed correctly for a database.
for a db, there would only be 3 columns:
date, code, cata
[TABLE="width: 144"]
<colgroup><col width="64" style="width: 48pt;" span="3"> <tbody>[TR]
[TD="width: 64, bgcolor: transparent, align: right"]1/1/2018[/TD]
[TD="width: 64, bgcolor: transparent"],ABC
[/TD]
[TD="width: 64, bgcolor: transparent, align: right"]123[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]1/2/2018,
[/TD]
[TD="bgcolor: transparent"]ABC [/TD]
[TD="bgcolor: transparent, align: right"]12301[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]1/1/2018,
[/TD]
[TD="bgcolor: transparent"]BCD[/TD]
[TD="bgcolor: transparent, align: right"]145[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]1/2/2018,
[/TD]
[TD="bgcolor: transparent"]BCD[/TD]
[TD="bgcolor: transparent, align: right"]14502[/TD]
[/TR]
</tbody>[/TABLE]

youd have better results with Excel

[TABLE="width: 96"]
<colgroup><col width="64" style="width: 48pt;" span="2"> <tbody>[TR]
[TD="width: 64, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent, align: right"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]
[/TD]
[TD="bgcolor: transparent, align: right"][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

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