Solved

How to create a delete query to delete entire records

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

807 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