How to check if a filed is in another table?

R

Rodrigo Borges

I have 2 tables with a common field "server".

Table A has the following fields:
server
status
comment

I need to create a query based on "status" on table A:

If status = NOK then I need to check if servername (tableA) is in servername
(tableB)

How to do that?
 
O

Ofer Cohen

In the query add both tables, then link both tables using the server field
(click on the field in one table and then drag it to the field in the second
table) that way you'll get all the cmmon records
Now add the filter to the status field

"NOK"

In SQL it will look like

SELECT [TABLE A].*
FROM [TABLE A] INNER JOIN [TABLE B] ON [TABLE A].server = [TABLE B].server
WHERE [TABLE A].Status ="NOK"
 

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

Top