Solved

delete query in access

Posted on 2011-03-06
3
294 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 500 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

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Question has a verified solution.

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

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

689 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