Deleting data from a table through a query

L

lizasue

I have a database that is designed to update a list of credit union members
from a master list so that vehicle insurance coverage can be tracked. I have
been able to run an unmatched query to achieve a list of old members who have
either paid off their vehicles or moved their loans to other locations. What
I need to do now is delete these people from the main table. I have the
cascade update and delete funtion in place to delete the vehicle information
once the member is deleted, but I don't know how to take the information
found in the unmatched query and delete those members from the main table. I
really could use some help. Any suggestions?
 
J

John Spencer

IF you have a memberId and it is unique then you could use something
like the following.

DELETE MemberTable.MemberID
FROM MemberTable
WHERE MemberTable.MemberID in
(SELECT MemberID FROM UnmatchedQuery)

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
L

lizasue

Thanks! I'll give that a try.

--
Lizasue


John Spencer said:
IF you have a memberId and it is unique then you could use something
like the following.

DELETE MemberTable.MemberID
FROM MemberTable
WHERE MemberTable.MemberID in
(SELECT MemberID FROM UnmatchedQuery)

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top