Slab_Rankle
Registered User.
- Local time
- Today, 22:33
- Joined
- Aug 10, 2011
- Messages
- 36
Hey all,
I'm having an issue merging two queries of mine. Basically one shows a clients income and the other shows a clients expenditure. The tables in both queries consist of an Account Number, a Type and the AmountPaid. Usually there are more entries in the Expenditure query, but when I join them the IncomeType duplicates itself to the amount of Expenditure records in the query.
So, for example, if I have 4 Expenditure entries and 1 Income entry, the query shows 4 expenditure entries and 4 income entries. Now, I think what I need to do is a union query, but I'm unsure on how to structure it. Here's the SQL for both of the queries I mentioned earlier on:
Income Query:
SELECT IncomePaid.[Account Number], Income.IncomeType, IncomePaid.AmountPaid
FROM Income INNER JOIN IncomePaid ON Income.IncomeID = IncomePaid.IncomeID;
Expenditure Query:
SELECT ExpendPaid.[Account Number], Expenditure.ExpendType, ExpendPaid.ExpenditureAmount
FROM Expenditure INNER JOIN ExpendPaid ON Expenditure.ExpendID = ExpendPaid.ExpendID;
I want to do this so I can display both the Expenditure and Income on the same report as when I use a sub report it only lets me display the Income in the footer which is obviously right at the bottom of the page.If anyone could help that'd be great!!
I'm having an issue merging two queries of mine. Basically one shows a clients income and the other shows a clients expenditure. The tables in both queries consist of an Account Number, a Type and the AmountPaid. Usually there are more entries in the Expenditure query, but when I join them the IncomeType duplicates itself to the amount of Expenditure records in the query.
So, for example, if I have 4 Expenditure entries and 1 Income entry, the query shows 4 expenditure entries and 4 income entries. Now, I think what I need to do is a union query, but I'm unsure on how to structure it. Here's the SQL for both of the queries I mentioned earlier on:
Income Query:
SELECT IncomePaid.[Account Number], Income.IncomeType, IncomePaid.AmountPaid
FROM Income INNER JOIN IncomePaid ON Income.IncomeID = IncomePaid.IncomeID;
Expenditure Query:
SELECT ExpendPaid.[Account Number], Expenditure.ExpendType, ExpendPaid.ExpenditureAmount
FROM Expenditure INNER JOIN ExpendPaid ON Expenditure.ExpendID = ExpendPaid.ExpendID;
I want to do this so I can display both the Expenditure and Income on the same report as when I use a sub report it only lets me display the Income in the footer which is obviously right at the bottom of the page.If anyone could help that'd be great!!