Query : Return a result from one table if it doesn't exist in another (1 Viewer)

FameAsser

Registered User.
Local time
Today, 13:21
Joined
Aug 2, 2014
Messages
13
Hi all

So I have two queries...both feeding from linked tables. They now both have the exact same columns in them.

One is a table of "Placeholder Predictions"...so predictions all players have made prior to the game.

The second table has all the "New Predictions"...all predictions made by all players since.

So, What I need to do is return a list of all the New Predictions, but if a player has not predicted, it needs to default to the one in the Placeholder Prediction list instead.

How do I run a query which basically says "Select * from New...(but if a player doesn't have a prediction in here for this match, but they do have one in Placeholder, give me that instead)"

I've attached screenshots :

2016-07-09 (3).jpg - this is the Placeholder linked table

2016-07-09 (4).jpg - this is the New Predictions query which has been manipulated to show these columns.

So I need to pull these together, but for, say MatchID = 2, and Player 56, I would want to see the Placeholder Prediction...but for MatchID = 1, I would want to see the prediction in qryUpload - actually line #2 in qryUpload...that one came last and I can already filter that out.
 

sneuberg

AWF VIP
Local time
Today, 05:21
Joined
Oct 17, 2014
Messages
3,506
First you want a query that produces records from the "Placeholder Predictions" that are not in the "New Predictions". This is called an Unmatched query. You can use the query wizard to create one or this site has instructions on how to make you own. Then you can combine the result of this query with the "New Predictions with a union query.
 

Users who are viewing this thread

Top Bottom