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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using query as one source object for another query

Status
Not open for further replies.

uscitizen

Technical User
Jan 17, 2003
672
US
i want to count the number of records in a table which belong to each of value of a field (let's call it) 'A' and i want to identify those values of 'A' where the count exceeds a number stored in another field which has 'A' in it called 'B'.

i guess my question is this: would i use the query designer to create a select query to handle the first part of the task and then drag the resulting select query into the design window and link it with the second table to create a second query. and......would i need to run both queries in succession OR would the first query be actuated when the second query was run?
 
You can definitely use one query as one of the sources of data for another query. This is often necessary if you are grouping and counting, as it sounds like you are.

If you post your sql here I'm sure you'll get help on building the query you need.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Affordable Development, Professionally Done

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Hi -

Thanks, I came up with a 'workaround' utilizing two queries which are launched sequentially from within a macro. It'd be interesting to see what the sql would/could look like and I'll maybe play 'round with it in my free time.

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top