Reusing query results in VB 
Author Message
 Reusing query results in VB

I am trying to save the results of one select statement and reuse the
results in the 'where' of other select statements. So far I can't get
the reference correct.

Example:

   Select DeptNum from Training where [CourseNum] = 'value user entered'

This returns mutliple DeptNum's

Then I want to use the records selected from the above select as
criteria for other selects without having to reprocess.

Ex.  Select SSN, Name from Employee where Employee.DeptNum = 'one of
the           dept numbers from the first select'

I don't know what to put after the last equal sign. I have tried many
different ways based on somewhat similar examples in books and in the
online help without any success. Any help is very much appreciated.



Tue, 26 Oct 1999 03:00:00 GMT  
 Reusing query results in VB

You can base one query on another (New Query, Add Table, then pick Queries
to list a preexisting query).

or

You can usually build one (more complicated) query, instead of several
processes in sequence.

Or
If you really must, you can use a MakeTable query to store intermediate
results.  This is closest to what you were trying to do.  You will have to
manage (delete) these results tables when you are done.

HTH

--
Stephen Sarre
SIS
London UK

Infrequent visitor to this newsgroup



Thu, 28 Oct 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. OPENRESULTSET - Reusing Result Set Problem

2. using a query result to run another query

3. Truncated values in results of query upon query

4. Truncated values in results of query upon query

5. Howto execute one query over multiple query results

6. Howto execute one query over multiple query results

7. Truncated values in results of query upon query

8. display query results on form using VB

9. Different query results in Access 2000 than in VB

10. Help Passing sql query result to VB

11. How do I use results from SQL query in VB

12. VB ComboBox filled with Access Query Results

 

 
Powered by phpBB® Forum Software