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 1 / March 2006

Tip: Looking for answers? Try searching our database.

SQL Help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gn@dana.ucc.nau.edu - 21 Mar 2006 22:58 GMT
Been given a rush query to do in an access database, am quite rusty.
Here is what I need:

TABLE1
EMPLID, YEAR

TABLE2
EMPLID

TABLE3
EMPLID

OK, here is the logic as best as I can describe it:

I need to:

DELETE FROM TABLE1 WHERE TABLE1.EMPLID DOES NOT EQUAL TABLE2.EMPLID AND
YEAR < 2006
OR WHERE TABLE1.EMPLID = TABLE3.EMPLID

Am not sure about how to join the tables, if you could convert that
into useable SQL it would be appreciated....

Thanks
MGFoster - 21 Mar 2006 23:25 GMT
Perhaps:

DELETE *
FROM table1 as t1
WHERE [year] < 2006
AND NOT EXISTS (SELECT * FROM table2 WHERE emplid = t1.emplid)
AND EXISTS (SELECT * FROM table3 WHERE emplid = t1.emplid)
Signature

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

> Been given a rush query to do in an access database, am quite rusty.
> Here is what I need:
[quoted text clipped - 20 lines]
>
> Thanks
 
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.