Title: Message
You know, that wasn't even close to correct.  I didn't test it, and I was thinking of an UPDATE statement in my head.  My apologies.
 
For a DELETE, you're not allowed to include other tables in your query, but you can include them in a subquery:
 
DELETE FROM tblWorking
WHERE tblWorking.sort in (SELECT sort from tblBudgetHistory) AND
tblWorking.newpno in (SELECT newpno FROM tblBudgetHistory) AND
tblWorking.perioddate in (SELECT perioddate FROM tblBudgetHistory)
 
Try that one out.
 
Eric


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Richard Rogers Beasimer
Sent: Monday, June 27, 2005 2:52 PM
To: [email protected]
Subject: RE: [AccessDevelopers] Delete Statement

SQL isn't liking the JOIN part of the statement.  Errors out at "INNER".
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Eric Douglas
Sent: Monday, June 27, 2005 16:35
To: [email protected]
Subject: RE: [AccessDevelopers] Delete Statement
Importance: Low

DELETE FROM tblWorking
INNER JOIN tblBudgetHistory ON tblWorking.sort = tblBudgetHistory.sort and tblWorking.newpno = tblBudgetHistory.newpno ND tblWorking.perioddate = tblBudgetHistory.perioddate
 
You haven't joined the other table in the below query.
 
hope that helps,
Eric


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Richard Rogers Beasimer
Sent: Monday, June 27, 2005 2:33 PM
To: [email protected]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [AccessDevelopers] Delete Statement

I 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.perioddate
The 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!



Please zip all files prior to uploading to Files section.





Please zip all files prior to uploading to Files section.


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.





Please zip all files prior to uploading to Files section.




YAHOO! GROUPS LINKS




Reply via email to