Solved

Delete query

Posted on 2013-02-07
3
147 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

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

21 Experts available now in Live!

Get 1:1 Help Now