Limit Report to the 1st 30 records

  • Thread starter Thread starter Blair
  • Start date Start date
B

Blair

Have a Query that produces 200+ records want to find a way to limit today's
report to the first 30 records. after today most of those 30 records wont be
in tomorrows report, so tomorrows report would show a few of yesterdays and
the and the rest of the queries records up to the next 30 counting the left
over from yesterday. Over the course of the week the 200+ records will drop
to about 10-15 which a different report will pick them up and I quit using
this report.
Is there an easy way of doing this
Thanks Blair
 
Use the TOP operator in your query.

SELECT TOP 30 FieldA, FieldB, ...
FROM YourTable
ORDER BY FieldC Desc, FieldA, FieldB

Which records are the TOP is determined by the sort order of the query. IF
there are ties for the last position, then all records that are "tied" are
returned.
 
In design view there are

Field
table
sort
show
Criteria
or
I am not very educated in this stuff, so do I put
SELECT TOP 30 FieldA, FieldB, ...
In the field Row
FROM YourTable
In the table Row, and
ORDER BY FieldC Desc, FieldA, FieldB
In the sort row, of a Blank column in my existing query
With the appropriate names of course
Thanks Blair
 
Tried
Expr1: (SELECT Top 30 [Nest #]From[98MatingRecords])
In the Field row of a Blank Column, but don't want to work
 
You only need to view the query properties. There is a Top property that you
can set.

--
Duane Hookom
MS Access MVP
--

Blair said:
Tried
Expr1: (SELECT Top 30 [Nest #]From[98MatingRecords])
In the Field row of a Blank Column, but don't want to work
John Spencer said:
Use the TOP operator in your query.

SELECT TOP 30 FieldA, FieldB, ...
FROM YourTable
ORDER BY FieldC Desc, FieldA, FieldB

Which records are the TOP is determined by the sort order of the query. IF
there are ties for the last position, then all records that are "tied"
are
returned.
 
In the query design grid
Right Click on the gray area and select Properties
Change Top Values from All to 30

Make sure your records are sorted so the top records when sorted are the
records you want to see.
 
How simple can you get! You people just keep amazing me with your knowledge
and willingness to help
Thankyou Blair
 
How simple can you get! You people just keep amazing me with your knowledge
and willingness to help
Thankyou Blair
Duane Hookom said:
You only need to view the query properties. There is a Top property that you
can set.

--
Duane Hookom
MS Access MVP
--

Blair said:
Tried
Expr1: (SELECT Top 30 [Nest #]From[98MatingRecords])
In the Field row of a Blank Column, but don't want to work
John Spencer said:
Use the TOP operator in your query.

SELECT TOP 30 FieldA, FieldB, ...
FROM YourTable
ORDER BY FieldC Desc, FieldA, FieldB

Which records are the TOP is determined by the sort order of the query. IF
there are ties for the last position, then all records that are "tied"
are
returned.


Have a Query that produces 200+ records want to find a way to limit
today's
report to the first 30 records. after today most of those 30 records wont
be
in tomorrows report, so tomorrows report would show a few of yesterdays
and
the and the rest of the queries records up to the next 30 counting the
left
over from yesterday. Over the course of the week the 200+ records will
drop
to about 10-15 which a different report will pick them up and I quit using
this report.
Is there an easy way of doing this
Thanks Blair
 
Back
Top