I added a
UniqueID field to tblWorking and then modified my query as
follows:
DELETE FROM tblWorking
WHERE UniqueID IN
(SELECT tblWorking.UniqueID
FROM tblWorking JOIN tblBudgetHistory
ON tblBudgetHistory.sort = tblWorking.sort
AND tblBudgetHistory.newpno = tblWorking.newpno
AND tblBudgetHistory.perioddate = tblWorking.perioddate
AND tblBudgetHistory.sort BETWEEN 24 and 26)
WHERE UniqueID IN
(SELECT tblWorking.UniqueID
FROM tblWorking JOIN tblBudgetHistory
ON tblBudgetHistory.sort = tblWorking.sort
AND tblBudgetHistory.newpno = tblWorking.newpno
AND tblBudgetHistory.perioddate = tblWorking.perioddate
AND tblBudgetHistory.sort BETWEEN 24 and 26)
It appears
to be doing what I want now.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Richard Rogers Beasimer
Sent: Monday, June 27, 2005 16:33
To: AccessDevelopers@yahoogroups.com; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [SQL_beginners] Delete Statement
Importance: LowI about ready to give up on this.What's wrong with my delete statement?DELETE FROM tblWorking
WHERE tblWorking.sort = tblBudgetHistory.sort
and tblWorking.newpno = tblBudgetHistory.newpno
AND tblWorking.perioddate = tblBudgetHistory.perioddateThe idea is to remove every entry in tblWorking that has a corresponding entry in tblBudgetHistory.RRB
NOTICE: This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure, or distribution is prohibited. The contents of this e-mail are confidential. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Please virus check all attachments to prevent widespread contamination and corruption of files and operating systems!
---- LSpots keywords ?>---- HM ADS ?> NOTICE: This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure, or distribution is prohibited. The contents of this e-mail are confidential. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Please virus check all attachments to prevent widespread contamination and corruption of files and operating systems!
Please zip all files prior to uploading to Files section.
---- LSpots keywords ?> ---- HM ADS ?>
YAHOO! GROUPS LINKS
- Visit your group "AccessDevelopers" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.