How query for Records in table 1, but not in table 2 ?
I am a very much novice at Access. Please help.
Have two tables with data about servers from two sources.
Table1 has HOSTNAME, SERIAL, IP
Table2 has HOSTNAME, SERIAL, IP
I need
Hostnames that appear on Table1, but not on Table2.
I put the fields of Table1 in a query. In criteria in first column under HOSTNAME, I put
<>All (SELECT [HOSTNAME] FROM [Table2] WHERE [HOSTNAME] = HOSTNAME)
But get nothing. I think because I am joining on this field and/or because I am selecting for hostnames the same where I am looking for hostnames different, but when I take the where clause out, I get syntax error.
On right track but need NOT found in table2
Thanks Corrupter for your reply. We are close. I removed the Where because I don't want only when NULL in table2.
What I end up with is all in table1 that ARE in table2. Guess I want the converse - those in table1 that do not appear in table2.
Would I just use NOT or !=? Will try some of that stuff.
NOT IN (select hostname from table2...)
Corruptor
Was able to tweak it up to get needed result using NOT IN select from (table2) kind of thing. The IN seems to make the pointer advance through the select subquery comparing each result to the main query condition.
Thanks for your help. I probably confused you with my wording. But you have brought about the solution to the problem.
Thank you...