Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble counting entries

Status
Not open for further replies.

Sussex

MIS
Nov 13, 2001
12
US
I am trying to create a query that will return the last, meaning by date from today back, 20 entries for a particular user. I can not just go back 20 days from today since the user may not have worked twenty consecutive days. What do you think is the best way to accomplish this?

Thanks in advancec
 
Look up Top or Top Value either in these fora or in Access help. It should give you what you are looking for.
 
Thanks for your answer. Is there a way to do this without vb? If I query my database for userid 1200 to return all of 1200 records ordered from latest date down, how would I extract just the latest 20? Can I do this without creating a new table just outputting it to a report.
 
A query of the form
Code:
Select TOP 20 fld1, fld2, flddate, ...
From tbl
Order by 3 DESC
Its what evalesthy was refering to.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top