If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Top Records
I am using a database to which 10 telemarketers are
connected. When I run a query with specific criteria I get a number of records that fit the criteria. My first counts those records, giving me an "x" number result. My second query takes that number and divides it by 10 (telemarketers) and gives me the number of records I should assign to each telemarketers individual databases. My third query uses the "Select Top... Records" function (built into the query). I have to type into the "Select Top" function the number resulting from my second query in order to make a table for each telemarketer with that number of records (stated in the Select Top function). Is there a code I can use to have the Select Top filled in automatically from the result of the second query? I do not want to have to type in the "Select Top" (with the result from the second query)every time I have change the criteria from the first query. Thanks, Gabby |
#2
|
|||
|
|||
Top Records
On Mon, 31 May 2004 14:17:50 -0700, "Gabby"
wrote: My third query uses the "Select Top... Records" function (built into the query). I have to type into the "Select Top" function the number resulting from my second query in order to make a table for each telemarketer with that number of records (stated in the Select Top function). Is there a code I can use to have the Select Top filled in automatically from the result of the second query? You may need to write VBA code to actually construct the SQL for this third query on the fly, incorporating the desired record count. You can't pass a TOP value as a query parameter. You might be able to use a criterion on a DCount() function, but it would be complex, clunky and slow! John W. Vinson[MVP] Come for live chats every Tuesday and Thursday http://go.compuserve.com/msdevapps?loc=us&access=public |
Thread Tools | |
Display Modes | |
|
|