Solved

delete query in access

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RAISERROR WITH NOWAIT 2 29
SQL Select Query help 1 47
Question about Common Table Expressions 3 39
SQL query joining 6 tables in asp.net 4 18
Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 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