I am attempting to create a query that I am going to use to create a report out of. The query needs to include 4 fields:
- Project_Title
- Resource_Name
- SumOfHoursAllocated
- SumOfDuration
I am currently trying to do this by joining two queries together that I have already made. The first one contains
- Project_ID
- Resource_ID
- SumOfHoursAllocated
And the second one contains
- Project_ID
- Resource_ID
- SumOfDuration
Projects and resources are each stored in separate tables (called Projects and Resources) with their names and ID fields as well as some other fields that I don't think are relevant.
My problem is that I cannot figure out how to join the two queries in such a way that it displays 2 numbers for each Project resource combo. I have gotten many different results from error messages to no data showing up when I run the query.
Code:
SELECT Projects.Project_Title, Resources.Resource_Name, [Grouped Hours qry].SumOfDuration, [Grouped Allocation qry].SumOfHoursAllocated
FROM [Grouped Hours qry] INNER JOIN (([Grouped Allocation qry] INNER JOIN Projects ON [Grouped Allocation qry].Project_ID = Projects.Project_ID) INNER JOIN Resources ON [Grouped Allocation qry].Resource_ID = Resources.Resource_ID) ON ([Grouped Hours qry].Resource_ID = Resources.Resource_ID) AND ([Grouped Hours qry].Project_ID = Projects.Project_ID);
The above code is the most recent one I tried and it only returned results that that had an entry for both allocation and duration. I need it to display all entries in allocations and duration with either zeros or nulls where there is only data for one or the other.
Also this code is returning the ambiguous outer joins message but I cant seem to figure out a work around.
Thanks for any help or advice anyone can offer.