Crosstab Query with data from two tables

KRossVD

New Member
Joined
Jul 29, 2014
Messages
7
I am relatively new at working with queries. I have two tables, one with realized expenses fro certain months and another with budgeted items for certain months. I am trying to create a query which will take all the expenses, put them into the categories I have them labeled under and sum for each category for each individual month. I can get this far (although the dates aren't in order) but I also need to attach the budget for the last months expenses as the last column in the query table and this I have no idea how to do. Any help would be much appreciated.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
You could make a query for each table (tExp, & tBudg) that sum the fields needed, but add a month column (say [YrMo] so both queries can be joined (like: format([ItemDate],"yyyy-mm") as "YrMo" )
Join the 2 queries on like fields and [YrMo], now expenses and budget come together on 1 line/month.

'sorry I missed the crosstab ref....note You wouldnt join if you want Xtabs to be month, Xpense, Budget., it would be a UNION query.
select * from qsExps
union
select * from qsBudget

Then run cross tab on that qry...qnExp&Buget
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,050
Messages
6,122,868
Members
449,097
Latest member
dbomb1414

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