Reference object

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to list all patients (from my patients table) that are <> to query1.
When I enter Query1 in the criteria access does not recognize query1. How
can I do this.

This is what I did, in query2 I entered <>[query1]![patient key] in the
criteria of patient key in query2.
Thank You
 
Unless query1 will be in the new query, it won't recognize [query1]![patient
key]

Try instead using SubQuery like:

As SQL:

Select * From TableName Where [patient key] Not In (Select [patient key]
From Query1)

Or, in the criteria section write
Not In (Select [patient key] From Query1)


This is what I did, in query2 I entered <>[query1]![patient key] in the
criteria of patient key in query2
 
Or your could add query1 to your query and do a left join, something like:

SELECT yourTable.*
From yourTable LEFT JOIN query1
ON yourTable.[patient key] = query1.[patient key]
WHERE query1.[patient key] IS NULL

HTH
Dale
 
Thank you for your response, very helpful
Sherry

Ofer Cohen said:
Unless query1 will be in the new query, it won't recognize [query1]![patient
key]

Try instead using SubQuery like:

As SQL:

Select * From TableName Where [patient key] Not In (Select [patient key]
From Query1)

Or, in the criteria section write
Not In (Select [patient key] From Query1)


This is what I did, in query2 I entered <>[query1]![patient key] in the
criteria of patient key in query2
--
Good Luck
BS"D


Sherry said:
I want to list all patients (from my patients table) that are <> to query1.
When I enter Query1 in the criteria access does not recognize query1. How
can I do this.

This is what I did, in query2 I entered <>[query1]![patient key] in the
criteria of patient key in query2.
Thank You
 
Back
Top