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 / Queries / August 2006

Tip: Looking for answers? Try searching our database.

Query from two tables to compare

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
de Vroede - 07 Aug 2006 13:36 GMT
Hi,

I'm having difficulty building a query that compares two tables. I'm
using access 2000 on win2000.

I have a hardware db that contains a table with hardware, a table with
users and a table where hardware is linked to users (called tbl_assets)
.

I filled the hardware list from an excel file and I want to update the
asset table with data from the hardware list and link them to a default
user. but I don't want to have multiple values, so values allready in
the asset table should be skipped.

I've tried to use a criteria that should exclude values in the
tbl_assets IDhardware column, but the query doesn't like that.

regards,

jeroen
Brendan Reynolds - 07 Aug 2006 14:15 GMT
You can do it with a sub-query ...

INSERT INTO TargetTable (TargetID, TargetText) SELECT SourceID, SourceText
FROM SourceTable WHERE SourceID NOT IN (SELECT TargetID FROM TargetTable)

Signature

Brendan Reynolds
Access MVP

> Hi,
>
[quoted text clipped - 16 lines]
>
> jeroen
de Vroede - 08 Aug 2006 07:54 GMT
Thanks,

this works great!

regards,

jeroen

> You can do it with a sub-query ...
>
[quoted text clipped - 25 lines]
> >
> > jeroen
 
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.