I have a table that has 17 sales representatives (over 15,000 records). How can take 20 records from each Sales Rep and put them into 17 different tables?
I work for a print house and our client wants to see sample data for each sales rep within the file. 20 records of each to be exact. We use the data to create print proofs.
Why not just write a query? Or a report? Or make a form based on your Sales person table, with a subform showing 20 records for each? Is this something you have to do one time? or any time they want it? What's a "print proof"?
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
You want to return 20 records for EACH sales rep? The top 20 for each on sales amount? How do you want to determine the 20?
You have a table right now that contains records...one of the fields is SalesRepID? Are there any other fields that you'll need?
It's a lot more helpful if you will provide some basic information:
[tt]
I have a table that looks like this with this data: tblName and ID is the Primary Key
ID SalesRep Otherfield1 Otherfield2
data data data data
data data data data
data data data data
data data data data
I need to return 20 records for each sales rep. I want the
latest by date?
most by sales amount?
some other criteria?
I need the results to look like this:
SalesRep OtherField1 OtherField2
data data data
data data data
data data data
data data data[/tt]
Being able to see a "picture" of what you have and what you want is more helpful.
This is what my table looks like now:
Contact Name OtherField1 OtherField2
Rhonda Adcox data data
Donna Miller data data
Chuck Adcox data data
Linda True data data
This is what I have written so far and it works but I want a query that will pull 20 records of each Contact. Right now it only pulls 5 records of one contact, "William J. LaBarge".
INSERT INTO Resource
SELECT TOP 5 *
FROM [TRF Final]
WHERE ((([TRF Final].[VGI Contact Name])="Rhonda Adcox"));
I need the results to look like this:
Contact Name OtherField1 OtherField2
Rhonda Adcox data data
Rhonda Adcox data data
Rhonda Adcox data data
Rhonda Adcox data data
Rhonda Adcox data data
Donna Miller data data
Donna Miller data data
Donna Miller data data
Donna Miller data data
Donna Miller data data
Chuck Adcox data data
Chuck Adcox data data
Chuck Adcox data data
Chuck Adcox data data
Chuck Adcox data data
Linda True data data
Linda True data data
Linda True data data
Linda True data data
Linda True data data
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.