if statement query

  • Thread starter Thread starter msam137
  • Start date Start date
M

msam137

I am trying to run create a microsoft query any help would be forever
appreciated. I want to compare two tables lets say table1 field A and
table2 field A I want to be able to create a table of all the fields
that are in table1 Field A that are not in table2 Field A. Along with
the result set I want the additional columns that are in table1. Table1
field A and Table2 field A have the same format and possible data in
them both. After this result set I will want to try to take it a step
furhter by extending the comparison to a second column that are in both
tables.
 
Sounds like an unmatched query. when you click on new query, that is one of
the wizrds that are available to you.
 
SELECT FieldA,FieldB...INTO tblNew
FROM table1
WHERE FieldA NOT IN (SELECT table2.FieldA FROM table2)
 
Norman appreciate your help I had tried Rick's and got the results that
I was looking for just did not understand how the Is Null accomplished
that.
But Norman where would I key your command at.
 
In short, it pulls records from both tables and sort of places them side by
side. If there is not a record in the second table, then the key field you
are comparing is blank for that table.

That is a non-technical explanation of an unmatched query.

(Note: If you view your query in SQL (click VIEW/SQL View) you will see a
statement like the one Norman posted for you.



Rick B
 
ok that is great can I also type up my own commands in that view sql
window inside access.
 
Not "commands" but, yes you can enter "sql statements" there.

Rick B
 
ok that is great can I also type up my own commands in that view sql
window inside access.

Just be aware that the JET/Access dialect of SQL is nonstandard (just
in a different manner than the non-standardness of SQL/Server, MySQL,
Oracle, etc. etc.) - if you're used to SQL/Server T-SQL you'll need to
make adjustments.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top