udidosa
udidosa

Reputation: 135

Deleting empty records from a table (Access 2013)

Theere is a Tasks table and a Contacts table where the initial data is stored

Upvotes: 1

Views: 1990

Answers (1)

Rene
Rene

Reputation: 1093

Below statement deletes all records in EmployeestoTasks having a task that does not exist in Tasks:

DELETE
FROM EmployeestoTasks
WHERE NOT EXISTS
(
SELECT '1'
FROM Tasks
WHERE Tasks.Title = EmployeestoTasks.Task
)

Upvotes: 1

Related Questions