Solved

How to create a delete query to delete entire records

Posted on 2016-11-30
2
36 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 41907649
try this query


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

Author Closing Comment

by:Fritz Paul
ID: 41907657
Thank you very much.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ms access vba split-screen form needs to be refreshed on load 7 31
convert null in sql server 12 34
SQL Error - Query 6 26
is Microsoft Access going to Die? 9 50
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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…
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…

777 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