Query Two Tables

AOGFADUGBA

Board Regular
Joined
Sep 30, 2015
Messages
74
Hi All, please is there a way to query two tables for records that falls between a date range.
The first table is for credit records and the second table is for debit records.
I want to create a cash book with the two tables. getting the credit record on one side and the debits record on another side of the query and all the records from the two tables must fall between the same date range. ie credit for march and debit for march.
can someone help. thanks
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
What is the structure of each of the tables? ie. Field names? and table names?
 
Upvote 0
Thanks for your resonse alansidman
Table1[payment] fields: date; voucherNo; paid to; details; amount; chequeNo; cash; Bank
Table2[Receipt] fields: date; voucherNo; Received From; amount; No On Bank slip; Cash; Bank
Thanks
 
Upvote 0
It does not appear that you have a relationship between the two tables as there does not appear that there are Primary Keys and Foreign Keys. As such, I would run a query on each table using the Between Function on the Date Field. Then create a Union Query joining the two queries that have the result you are looking for.
 
Upvote 0
Thank was able to figure it out, created a union all query and i got all the dates from the two tables into one column, then i did a many to many query to get all the dates in the union all from both tables.
Thanks a lot
 
Upvote 0

Forum statistics

Threads
1,214,388
Messages
6,119,227
Members
448,878
Latest member
Da9l87

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