Solved

delete query in access

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mySQL Syntax 7 34
SQL 2012 R2 Express report problem 2 83
SQL Server CASE .. WHEN .. IN statement - Syntax issue 4 50
Help writing a query 6 71
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…
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. …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now