SheilaAlighieri
Technical User
Hi guys!
I have been struggeling with a Access problem for days but I reckon it is very easy to solve for one of you professionals
So here goes:
I am trying to link two tables (named "Budget" respectively "Invoice"
to acquire certain information for a report. I joined the tables on the basis of three fields (namely "Budget Year", "Quarter" and "Account Name"
. As for my problem. When the data in the two tables correspond for a specific year, quarter and account all data is shown and nothing is wrong. But when the budget table contains data for a certain budget year, quarter and account name which aren't represented in the invoice table, they are left out! I wish for all data in both tables to be seen, but I can't get it to work. To clarify matters somewhat I will attach my sql code below.
SELECT [Invoice].[Budget Year], [Invoice].Quarter, [Invoice].[Account Name], [Invoice].[Amount in Euro], [Budget].Budget
FROM [Invoice] LEFT JOIN [Budget] ON ([Invoice].[Account Name] = [Budget].[Account Name]) AND ([Invoice].[Budget Year] = [Budget].[Budget Year]) AND ([Invoice].Quarter = [Budget].Quarter)
GROUP BY [Invoice].[Budget Year], [Invoice].Quarter, [Invoice].[Account Name], [Invoice].[Amount in Euro], [Budget].Budget;
I tried to change the join to an OUTER JOIN but in that case the program gives me an error
I hope I've been clear enough, cause I am terrible at explaining these sort of things. Any help would be greatly appreciated.
Thanks!
Sheila
I have been struggeling with a Access problem for days but I reckon it is very easy to solve for one of you professionals
I am trying to link two tables (named "Budget" respectively "Invoice"
SELECT [Invoice].[Budget Year], [Invoice].Quarter, [Invoice].[Account Name], [Invoice].[Amount in Euro], [Budget].Budget
FROM [Invoice] LEFT JOIN [Budget] ON ([Invoice].[Account Name] = [Budget].[Account Name]) AND ([Invoice].[Budget Year] = [Budget].[Budget Year]) AND ([Invoice].Quarter = [Budget].Quarter)
GROUP BY [Invoice].[Budget Year], [Invoice].Quarter, [Invoice].[Account Name], [Invoice].[Amount in Euro], [Budget].Budget;
I tried to change the join to an OUTER JOIN but in that case the program gives me an error
Thanks!
Sheila