how to get few records from the total records

T

thread

hi

i'm trying to operate a report when only few records should appear]
for example
if i have 10-15 records from same event
i would like to get only 3
of course if there is only 2,so only the 2 records will appear
is it posible?
 
M

Marshall Barton

thread said:
i'm trying to operate a report when only few records should appear]
for example
if i have 10-15 records from same event
i would like to get only 3
of course if there is only 2,so only the 2 records will appear


Try setting the report's record source query Top Values
property to 3
 
T

thread

how should i set the values when every serial number have several
records and i want to delimit the serial number to give just the 3
records for example
thread said:
i'm trying to operate a report when only few records should appear]
for example
if i have 10-15 records from same event
i would like to get only 3
of course if there is only 2,so only the 2 records will appear

Try setting the report's record source query Top Values
property to 3
 
M

Marshall Barton

thread said:
how should i set the values when every serial number have several
records and i want to delimit the serial number to give just the 3
records for example
thread said:
i'm trying to operate a report when only few records should appear]
for example if i have 10-15 records from same event
i would like to get only 3

Try setting the report's record source query Top Values
property to 3


If you want to get the top three records for each event,
then you need to use a TOP 3 subquery in the criteria.

I can not write that for you unless you provide a Copy/Paste
of your existing query, explain which field(s?) is the
primary key and how you determine the three records to be
displayed.
 
T

thread

thread said:
how should i set the values when every serial number have several
records and i want to delimit the serial number to give just the 3
records for example
thread wrote:
i'm trying to operate a report when only few records should appear]
for example if i have 10-15 records from same event
i would like to get only 3
Try setting the report's record source query Top Values
property to 3

If you want to get the top three records for each event,
then you need to use a TOP 3 subquery in the criteria.

I can not write that for you unless you provide a Copy/Paste
of your existing query, explain which field(s?) is the
primary key and how you determine the three records to be
displayed.
thank you for thr quick replay,i will try to show you some example of
a table and how i want the information to be populated
lets say we have 3 fields
serial number,version date,comments

SR1 ver1 first develop
SR1 ver2 second develop
.............................
SR1 ver100 final develop
SR2 ver1 first develop
................................
SR2 ver100 final develop

i would like to get the top 3 records from every serial number
SR1->ver100,ver99,ver98
SR2->ver100,ver99,ver98
all the information of the records but only 3 per group
 
M

Marshall Barton

thread said:
Marshall Barton wrote:

thread said:
how should i set the values when every serial number have several
records and i want to delimit the serial number to give just the 3
records for example
Marshall Barton wrote:
thread wrote:
i'm trying to operate a report when only few records should appear]
for example if i have 10-15 records from same event
i would like to get only 3
Try setting the report's record source query Top Values
property to 3

If you want to get the top three records for each event,
then you need to use a TOP 3 subquery in the criteria.

I can not write that for you unless you provide a Copy/Paste
of your existing query, explain which field(s?) is the
primary key and how you determine the three records to be
displayed.
i will try to show you some example of
a table and how i want the information to be populated
lets say we have 3 fields
serial number,version date,comments

SR1 ver1 first develop
SR1 ver2 second develop
............................
SR1 ver100 final develop
SR2 ver1 first develop
...............................
SR2 ver100 final develop

i would like to get the top 3 records from every serial number
SR1->ver100,ver99,ver98
SR2->ver100,ver99,ver98
all the information of the records but only 3 per group


That looks like you want a single result field with the
highest three versions. BUT, you also said you want "all
the information of the records" without providing an example
of the other information or how it relates to the serial
number or version. This looks like a conflict of goals so I
really don't understand exactly what you want from this or
where this is going from here.

In order to get the "latest" (i.e. Top) versions, it is
absolutely necessary to sort the versions. That in turn
requires you to specify **exactly** how to sort the version
indentifiers. I can not extract precise information from
your generalizations, so please be very specific using your
real data.

If you try to sort versions like what you posted, you would
get
ver99. ver98, ver2, ver100, ver1
which is clearly not what you want. This means that a Text
version identifier field has to be parsed to determine the
portion that can be used to sort them the way you want. If
the version identifier is a Number type field, then say so.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top