Query the last 5 dates

  • Thread starter turks67 via AccessMonster.com
  • Start date
T

turks67 via AccessMonster.com

How do I query the last 5 dates in a query even if dates in between are
missing.
 
J

John W. Vinson

How do I query the last 5 dates in a query even if dates in between are
missing.

Use the TOP VALUES property of the query, and sort by descending date.

That said... you're assuming that we have a lot more knowledge of the
structure of your table and your query than we can see.
 
J

Jeff Boyce

We aren't there. We can't see what you're working with.

We don't know what your (?first) query looks like, or what kind of data it
returns.

More specific description may lead to more specific suggestions.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
T

turks67 via AccessMonster.com

If I have 10 dates in a query. How can I only show the first 5 current dates
when the query is open.
 
J

Jeff Boyce

Are you saying that your first query returns 10 dates, and that you want
"the first 5"?

If so, how are you defining "first"? Are those the oldest, or the most
recent?

(hint: take a look in Access HELP at the "Top" property -- you can use this
to limit the number of responses to, say, 5!)

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

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