A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

"Delete" issue



 
 
Thread Tools Display Modes
  #1  
Old November 10th, 2004, 07:43 PM
PattyD
external usenet poster
 
Posts: n/a
Default "Delete" issue

Performing a Delete query, I link 2 tables that have the same unique
information; example record 123 and record 123. I want to delete matching
data from ONE table, but leave in the other. When I run the DELETE, an
message box will appear and ask me to specify which table to delete from. I
have the correct table selected, but it will not perform.
I have worked around this in the past, by updating the items I want deleted
with a "flag", and then doing a separate delete query.
There has to be a better way!! Any suggestions?

--
PattyD
  #2  
Old November 10th, 2004, 07:54 PM
JL
external usenet poster
 
Posts: n/a
Default

Hi PattyD,
Please try it on a TEST MDB before actually do it on the really MDB.

I have another way, for example if you Table Original and Copy. They have
identical fields on both tables. You want to delete the record from Copy
that you already have in Original. If both table have ID 123, you want 123
delete from Table Copy. This query will do it for you.

delete from Copy.ID
where Copy.ID in (select Original.ID from Original);

This will remove all the records in Table Copy that have the same ID in both
tables.

Hope this helps.

"PattyD" wrote:

Performing a Delete query, I link 2 tables that have the same unique
information; example record 123 and record 123. I want to delete matching
data from ONE table, but leave in the other. When I run the DELETE, an
message box will appear and ask me to specify which table to delete from. I
have the correct table selected, but it will not perform.
I have worked around this in the past, by updating the items I want deleted
with a "flag", and then doing a separate delete query.
There has to be a better way!! Any suggestions?

--
PattyD

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DELETE query error message HeatherD25 Running & Setting Up Queries 10 October 23rd, 2004 08:26 PM
completely delete office2000 jason Setup, Installing & Configuration 1 May 28th, 2004 10:08 AM
Delete - confirmation required Elfie General Discussion 2 May 21st, 2004 05:51 PM


All times are GMT +1. The time now is 03:38 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.