Solved

Delete query

Posted on 2013-02-07
3
146 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
Comment Utility
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
Comment Utility
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
Comment Utility
thx guys, yes i tried writing psuedocodish to assist.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

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

17 Experts available now in Live!

Get 1:1 Help Now