?
Solved

delete query in access

Posted on 2011-03-06
3
Medium Priority
?
296 Views
Last Modified: 2012-05-11
I have a query that tells me which codes to delete from a table, how do I create a delete query when there is a join? The table TblCWCodesForUnmatch contains all [mvris cides] that have been deleted since last month but of course there are not all represented in the AbiToMvris table but they need to be deleted form the AbiToMvris nonetheless.

regards in advance

SELECT TblCWCodesForUnmatch.[MVRIS CODE], AbiToMvris.[MVRIS CODE]
FROM AbiToMvris LEFT JOIN TblCWCodesForUnmatch ON AbiToMvris.[MVRIS CODE] = TblCWCodesForUnmatch.[MVRIS CODE]
WHERE (((TblCWCodesForUnmatch.[MVRIS CODE]) Is Not Null));

Open in new window

0
Comment
Question by:PeterBaileyUk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:PeterBaileyUk
ID: 35045864
can this be done in vba as a recordset?
0
 
LVL 77

Accepted Solution

by:
peter57r earned 2000 total points
ID: 35045916
Backup first and then try this..


Delete * from AbiToMVRS where exists
(Select [mvris code] from TblCWCodesForUnmatch where TblCWCodesForUnmatch.[mvris code] = abitomvrs.[mvris code])
0
 

Author Closing Comment

by:PeterBaileyUk
ID: 35045984
worked a treat thx
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question