Solved

delete query in access

Posted on 2011-03-06
3
288 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
Comment Utility
can this be done in vba as a recordset?
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
Comment Utility
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
Comment Utility
worked a treat thx
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

16 Experts available now in Live!

Get 1:1 Help Now