Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query dilema/need suggestions

Status
Not open for further replies.

jm2

MIS
Oct 20, 1999
7
US
I am developing a query that looks for the following criteria:<br>
<br>
1). looks for the presence of an environment variable, in this case &quot;bmhcc_stdver&quot;<br>
<br>
2). excludes all pc's that have another environment variable, in this case bmhcc_stdver !=&quot;3.2&quot;<br>
<br>
3). then the last step of the query, I want all of the pc's that fit the above two criteria AND do not have the file hf022498.pwr. <br>
<br>
The problem I get is that it returns me every file in the database that is not hf022498.pwr...... on each machine that met the first 2 criteria. <br>
<br>
Any ideas?<br>

 
I received the answer to this dilema from Dave Yarbrough. The correct way <br>
to do this is via subselect query. Here is how you do it<br>
1). Create a query that finds all system names that HAVE the file in <br>
question. Name it something like HAS pet.xls<br>
2). Create a second query. Use criterion type of &quot;subselected values&quot;. <br>
THIS IS THE IMPORTANT PART... USE SYSTEM NAME &quot;not in&quot; Browse to your <br>
query you created in step one. Name it something like W/O pet.xls<br>
<br>
It makes perfect sense after I had it handed to me. I returned the system <br>
name with the first query, so I want to find out all the system names that <br>
do not have the file. In my situation, I had <br>
other criteria to meet before this query was complete. I created another <br>
criteria that met the other two criteria and created a collection with <br>
that query. I then used this collection to limit the workstation <br>
population. One important reminder is to use the same limiting collection <br>
when creating your final collection that you used in your final query. For <br>
some goofy reaason, the collection in your query is not retained.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top