Solved

How to create a delete query to delete entire records

Posted on 2016-11-30
2
10 Views
Last Modified: 2016-11-30
I use Access 2010.
I have two tables and I want to delete all records from one table that correspond with the second table.
The select query of the records that I want to delete is:

SELECT TblOrdersHeader.*
FROM TblOrdersHeader INNER JOIN tblDeleteOrdersHeaderForSeasonSelect ON TblOrdersHeader.OrderID = tblDeleteOrdersHeaderForSeasonSelect.OrderID;

In the query builder it looks like here:
Looks like in builder
The result from the select query is like
Records that will be deleted
I do not manage to make a working delete query. Will you help please.
0
Comment
Question by:Fritz Paul
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
try this query


Delete TblOrdersHeader.*
 FROM TblOrdersHeader, tblDeleteOrdersHeaderForSeasonSelect
Where  TblOrdersHeader.OrderID In( Select tblDeleteOrdersHeaderForSeasonSelect.OrderID From tblDeleteOrdersHeaderForSeasonSelect)
0
 

Author Closing Comment

by:Fritz Paul
Comment Utility
Thank you very much.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

763 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

8 Experts available now in Live!

Get 1:1 Help Now