473,387 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Return only top n records in report

Hi,
I have a report based upon a query and a table.

Table is customers, query is for contrcators who work in a particualr
area.

The query upon which the report is based is a query of the table and
1st query.

I am trying to show for each customer, top n contractors in their
area.

However using the TOP function dispalys only the top n customers, not
*all* customers and top n contractors.

Help much appreciated
Nov 12 '05 #1
2 2829
Simplest way to do this report is to set the RecordSource of the report just
to the Customers table.

Then create a subreport based on a TOP n query into the Contractors table,
with the WHERE clause for the area.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Sasso" <br*******@virgin.net> wrote in message
news:c1**************************@posting.google.c om...
Hi,
I have a report based upon a query and a table.

Table is customers, query is for contrcators who work in a particualr
area.

The query upon which the report is based is a query of the table and
1st query.

I am trying to show for each customer, top n contractors in their
area.

However using the TOP function dispalys only the top n customers, not
*all* customers and top n contractors.

Help much appreciated

Nov 12 '05 #2
Al*********@SeeSig.Invalid (Allen Browne) wrote in
<3f**********************@freenews.iinet.net.au> :
Simplest way to do this report is to set the RecordSource of the
report just to the Customers table.

Then create a subreport based on a TOP n query into the
Contractors table, with the WHERE clause for the area.


If you want to do this with N being a choice by the user at
runtime, you need to set the recordsource at runtime, since there
is no way to parameterize the N in a TOP query.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lance | last post by:
Hi, I used sp_addlinkedserver to link to a remote server through ODBC. When I execute select count(*) from LinkSrv.SI.DBO.SIHeader in SQL Query Analyzer. It returns 13705 records. But when I...
4
by: sherkozmo | last post by:
SQL2000 - AccessXP I built an adp file with a stored procedure from SQL as follows: SELECT * FROM Z_mis_sjk_job_code_access WHERE job_code=@JobCode UNION ALL SELECT * FROM...
6
by: John | last post by:
I've got a single table I need to query to return records that have no "related records." Table dataset example: 1. John, Biology 2. Dave, Math 3. Susan, Biology 4. Betty, Sociology The...
0
by: Rob Dob | last post by:
I don't see a way to use the page settings from the RDLC Report, specifically to get it to print in Landscape. The PageHeight is set to 8.5in and the Width is set to 10in (for .5 in margins). I...
2
by: Alan T | last post by:
I have a SP: CREATE PROCEDURE dbo.users_name as select name from users order by name Here's my C# code: public string GetUserNames()
6
by: klove1209 | last post by:
Good afternoon, Can someone please tell me how I can return records from a query. I have text fields that I need to obtain, and have those necessary records sent to MS Word. I need to return the...
1
by: dfw1417 | last post by:
I have used a query and report filter to return records related to a specific account id. I want to print a report including only the latest 6 records out of the set returned by the record filter. I...
4
by: paulquinlan100 | last post by:
Hi I have the following query: SELECT qryBlackbook.* FROM qryBlackbook inner JOIN qryLatestMeetingDate ON (qryBlackbook.Site_Ref = qryLatestMeetingDate.Site_Ref) AND...
9
by: fperri | last post by:
I have a table that I need to pull all the records that have overlapping values in two fields (Min_LTV and Max_LTV) such as; Lender Product Min_LTV Max_LTV Lender1 ...
2
by: dmorand | last post by:
I realize that mySQL uses the Limit 5,10 type functionality, but I need to retrieve only records 5 thru 10 in my query. I'm assuming I need to use TOP.... I can do something like this, but I am...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.