bbwolff February 2016

Query to show whether an entry from one table is in the other

This might be simple, but I can't figure it out. In one table i have all the people, in the other some event with that people. I'd like to make a query where in first coloumn I get a list of people from table one and in the other a simple yes/no, based on whether their ID is in table two.

Answers


Cheetah February 2016

Open your query builder and ADD both tables (people and events).
Select fields from your PEOPLE table and at least one field from your EVENTS table. They should be joined via the Primary Key of the People table. Right click on the join between the 2 tables and select JOIN PROPERTIES. Select "Include all records from PEOPLE and only those from EVENTS where joined fields are equal." Use this formula in your YES/NO field: IIF(isnull([eventField]),"NO","YES")

That is one way of doing it...

Post Status

Asked in February 2016
Viewed 1,270 times
Voted 5
Answered 1 times

Search




Leave an answer