Solved

Delete query

Posted on 2013-02-07
3
149 Views
Last Modified: 2013-02-07
I would like to delete codes from 1 table that do not exist in another but not sure how to do that.

Table1 UploadforcedMatches (delete [vrr_vehicleid]) from this table
Table2 TblExportVinstems where vrr_vehicleID does not exist in here
0
Comment
Question by:PeterBaileyUk
3 Comments
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 400 total points
ID: 38863493
You've almost written the sql in prose there!!

DELETE FROM UploadforcedMatches
 WHERE NOT EXISTS
    (SELECT vrr_vehicleID                                        
   FROM TblExportVinstems
   WHERE TblExportVinstems .InvoiceID = UploadforcedMatches .vrr_vehicleID);
 
Backup before testing.
0
 
LVL 61

Accepted Solution

by:
mbizup earned 100 total points
ID: 38863500
Pete's got the SQL you need, but an easy way to do this through the query designer is to create a SELECT query that pulls the records that you want to delete, and then right-click the query builder window --> query type -->Delete Query
0
 

Author Closing Comment

by:PeterBaileyUk
ID: 38863586
thx guys, yes i tried writing psuedocodish to assist.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

773 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