S
Sam Davis
Hi and thanks for reading,
Working in VBA - this is part of an automated import function...
I have two tables Students and Reports. Most students have many reports, but
some don't have any reports. I wish to delete the ones with no reports.
This SELECT query shows all the records I wish to DELETE
SELECT Students.*
FROM Students LEFT JOIN Reports ON Students.StudentID = Reports.StudentID
WHERE Reports.StudentID Is Null;
Change to:
DELETE Students.*
FROM Students LEFT JOIN Reports ON Students.StudentID = Reports.StudentID
WHERE Reports.StudentID Is Null;
And Access gives the error "Could not delete from specified tables"
What am I doing wrong? I'm sure I've done this before.
Regards, Sam
Working in VBA - this is part of an automated import function...
I have two tables Students and Reports. Most students have many reports, but
some don't have any reports. I wish to delete the ones with no reports.
This SELECT query shows all the records I wish to DELETE
SELECT Students.*
FROM Students LEFT JOIN Reports ON Students.StudentID = Reports.StudentID
WHERE Reports.StudentID Is Null;
Change to:
DELETE Students.*
FROM Students LEFT JOIN Reports ON Students.StudentID = Reports.StudentID
WHERE Reports.StudentID Is Null;
And Access gives the error "Could not delete from specified tables"
What am I doing wrong? I'm sure I've done this before.
Regards, Sam