Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / March 2007

Tip: Looking for answers? Try searching our database.

Delete Query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rookie - 29 Mar 2007 10:53 GMT
Hi, this is my problem:

I need to delete from table "A", all fields that exist in table "B"

I tried a "delete query" but it sends an error "Please specify the table
where you want to delete the records" (its translate from spanish)

What Im doing wrong....???
Allen Browne - 29 Mar 2007 18:00 GMT
Assuming A and B match on a field named ID, you could use something like
this:
   DELETE FROM A
   WHERE EXISTS
   (SELECT B.ID FROM B WHERE B.ID = A.ID);

If subqueries are new, see:
   http://allenbrowne.com/subquery-01.html

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Hi, this is my problem:
>
[quoted text clipped - 4 lines]
>
> What Im doing wrong....???
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.