Show last 30 records

  • Thread starter Thread starter skusey
  • Start date Start date
S

skusey

Hi,

I have a form set up in Access and an underlying table. When this
particular form is selected by the user, I want the form to only
display the last 30 records inputted. I have a field in the underlying
table with a field called 'DateRecd' and only one record per date can
be added to this table (e.g. you cannot have 2 records inputted where
DateRecd = 02/10/06 etc). So basically, I want it to show the 30 most
recent records.

I cannot work out a way of doing this. Please note, I am an extreme
novice at this and so would appreciate if you could cut down on the
jargon because I won't understand it.

Many thanks in advance.
Ben
 
Sort backwards and use the Top predicate, like:

SELECT TOP 30 MyTable.*
FROM MyTable
ORDER BY DateField DESC;
 
skusey said:
Hi,

I have a form set up in Access and an underlying table. When this
particular form is selected by the user, I want the form to only
display the last 30 records inputted. I have a field in the
underlying table with a field called 'DateRecd' and only one record
per date can be added to this table (e.g. you cannot have 2 records
inputted where DateRecd = 02/10/06 etc). So basically, I want it to
show the 30 most recent records.

I cannot work out a way of doing this. Please note, I am an extreme
novice at this and so would appreciate if you could cut down on the
jargon because I won't understand it.

Many thanks in advance.
Ben

Note, as AM indicated, you need to sort to assure the results you want.
Tables do NOT have a fixed order. You must sort based on data in one or
more fields to establish a fixed order.
 

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

Back
Top