Solved

Delete query

Posted on 2013-02-07
3
153 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

734 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