Two Queries from the same field (1 Viewer)

aaronb50

Registered User.
Local time
Today, 11:17
Joined
Mar 2, 2014
Messages
185
I took over an old Co-Workers Program and there are some people wanting a few changes.

The only issue I'm having is on a report that is pulling from a few Queries.

Its pulling the sum of the Total Time field When the Type field = AO.

Well now they want to also be able to see the sum of the Total Time field when the Type field = PO.

I just copied and pasted the Query that is pulling the AO and changed it to PO and it works just fine. But the field name is the same so when I add it to the main Query and then the report its having issues.

What is the best way to go about doing this without having to completely redo the report?

I've though about housing the PO data on a separate table and somehow adding that to the Main Query but I'm not sure that is going to work correctly.
 

aaronb50

Registered User.
Local time
Today, 11:17
Joined
Mar 2, 2014
Messages
185
I get this when I try to do it the way I mentioned above:

The SQL statement could not be executed because it contains ambiguous outer joins. To force one of the joins to be performed first, create a separate query that performs the first join and then include that query in the SQL statement.
 

aaronb50

Registered User.
Local time
Today, 11:17
Joined
Mar 2, 2014
Messages
185
Thank you ridders!!!!!! You pointed me in the right direction.

It was an inner vs outer join issue. I just had to swap it up to get rid of the error message and then I was able to see that I could in fact pull both queries and they had different names even though they came from the same field and it working perfectly now.
 

Users who are viewing this thread

Top Bottom