how to select any last record in the querry

N

Naveed Pathan

hi friends i would like to know that how it is possible to select the last
ten records related to a particular suppliers.

supose a supplier supply me the goods and his name is john and i would like
to run a querry to retrieve his last ten records;
though i can do it with with help of in( ) function but that take time .
thankx
 
A

Allen Browne

However you define 'last' (date field?) sort by that field Descending, and
add the criteria to limit it to the particular supplier ('John'.) Then set
the query's Top property to
10
in the Properties box.

If you are trying to get the top 10 for all suppliers in the one query, use
a subquery. That will be slow: perhaps that's what you meant by the IN ().
If you need more help with this approach, see:
http://allenbrowne.com/subquery-01.html#TopN
 
N

Naveed Pathan

that's ok but dear i want the last ten records doesn't matter what are they
but i need the last ten records; not the top ten records
 
D

Duane Hookom

Why not answer Allen's question? Assume all of your record information is
recorded on marbles and thrown into a bag and mixed. You need to tell us how
you would be able to determine which of the marbles for a supplier were the
"last". If you can't identify the "last" from the information recorded on
the marbles then you won't be able to query the "last".

Please provide your table and field names as well as how you would define
"last".

Duane Hookom
MS Access MVP
 
N

Naveed Pathan

lets presume the date


Duane Hookom said:
Why not answer Allen's question? Assume all of your record information is
recorded on marbles and thrown into a bag and mixed. You need to tell us how
you would be able to determine which of the marbles for a supplier were the
"last". If you can't identify the "last" from the information recorded on
the marbles then you won't be able to query the "last".

Please provide your table and field names as well as how you would define
"last".

Duane Hookom
MS Access MVP
 
D

Duane Hookom

You have been helped here enough that you should understand how to read and
reply. Again,
<quote>Please provide your table and field names as well as how you would
define
"last".</quote>

Duane Hookom
MS Access MVP
 

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