Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 03-24-2015, 08:03 AM   #1
winshent
Newly Registered User
 
Join Date: Mar 2008
Location: London, UK
Posts: 162
Thanks: 35
Thanked 7 Times in 7 Posts
winshent is on a distinguished road
DELETE Queries with Joins

I'm really confused with this..

I have two queries, both delete from the same table and both have joins...

This one works:
Code:
DELETE  RequestCheck.*
FROM(
SELECT TOP 3 PayRequest.RequestID, PayRequest.GBPAmount, PayRequest.Currency, PayRequest.RequestDate
FROM PayRequest
WHERE (((PayRequest.Currency)="EUR Euro") AND ((PayRequest.RequestDate)>#11/16/2014#))
ORDER BY PayRequest.GBPAmount
) AS TOP3 INNER JOIN RequestCheck ON TOP3.RequestID = RequestCheck.RequestID
WHERE (((RequestCheck.CheckID)=8));
This one does not:
Code:
DELETE RequestCheck.*
FROM 300_tblDeleteRequestCheck INNER JOIN RequestCheck ON [300_tblDeleteRequestCheck].RCID = RequestCheck.RCID;
Can anyone make sense of this ?

winshent is offline   Reply With Quote
Old 03-24-2015, 09:11 AM   #2
jdraw
Super Moderator
 
jdraw's Avatar
 
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 11,572
Thanks: 57
Thanked 1,874 Times in 1,824 Posts
jdraw is just really nice jdraw is just really nice jdraw is just really nice jdraw is just really nice jdraw is just really nice
Re: DELETE Queries with Joins

This syntax works fine for me (seems similar to yours)
Code:
 DELETE Animal.*
FROM Animal INNER JOIN AnimalDeletes
  ON 
 [AnimalDeletes].DelID = Animal.AnimalID;
Attached jpg shows Animal table after the query; and AnimalDeletes shows records to be deleted.
Attached Images
File Type: jpg AnimalRelatedTables.jpg (15.5 KB, 64 views)
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jdraw is offline   Reply With Quote
Reply

Tags
delete , join

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Queries with joins to filter list box Lambo Forms 19 02-19-2014 02:35 AM
Joins and Queries 5 Stones Queries 3 09-09-2007 11:59 PM
VB, SELECT queries, Inner Joins, and trouble! Junkee Brewster Modules & VBA 2 10-03-2005 03:30 AM
Joins in Queries dcjones General 1 04-13-2004 08:22 PM
Joins in queries geoffD Queries 4 01-03-2004 10:49 AM




All times are GMT -8. The time now is 11:22 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World