The Join Properties don’t give the data I need (1 Viewer)

David Ball

Registered User.
Local time
Today, 21:53
Joined
Aug 9, 2010
Messages
230
Hi,

I have a query based on two other queries.
The source queries show TotalCost to-date for activities for the week, with the field ActivityNumber being the unique identifier. There is a query containing costs for the week just ended and another identical query showing costs for the week before. The idea is to get the difference between total cost to-date from the week just ended and total cost to-date from the prior week.
The two source queries are linked on the ActivityNumber fields.
The problem I have is that sometimes, though rarely, the ActivityNumber is changed for an activity.
In these cases the cost no longer appears in my query results because the ActivityNumber does not appear in both source queries.
I want to show all cases where there is an ActivityName in either source query. It seems that I only have options to show all from one query, all from the other, or where both are equal. None of these options will show me values for every ActivityName in either query, even if it is not in the other.
How can I do this in a query?
Thanks very much

Dave
 

plog

Banishment Pending
Local time
Today, 07:23
Joined
May 11, 2011
Messages
11,638
Please demonstrate your issue with data. Provide 2 sets:

A. Starting data from your tables. Include table and field names and enough data to cover all cases.

B. Expected results based on A. Show me what data you expect to end up with when you feed in the data from A.

Again, I want data;. What you are starting with and what you should end up with.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:23
Joined
May 21, 2018
Messages
8,525
QryAllActivities
Select ActivityName from qryPriorweek Union Select ActivityName from qryThisWeek

Now left join QryAllAcitivities on qryAllAcitivies.AcitivityName = qryPiorWeek.ActivityName and qryAllAcitivies.AcitivityName = qryThisWeek.ActivityName
 

Users who are viewing this thread

Top Bottom