Solved

How to create a delete query to delete entire records

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of utilizing SQL Server functions 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 Ac…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

749 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