A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How can I limit records in my report to the most recent date?



 
 
Thread Tools Display Modes
  #1  
Old November 18th, 2005, 12:55 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default How can I limit records in my report to the most recent date?

I have multiple records with multiple barrels and multiple dates. How can I
limit the records appearing in my report (from a Query) to one record with
the most recent date? Thank you! Greg
  #2  
Old November 18th, 2005, 01:09 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default How can I limit records in my report to the most recent date?

Sort your data by the date Desc, so the most recent record will be on top,
and then add to the query Top 1

Select Top 1 TableName.* From TableName Order By DateField Desc

--
Please respond to the group if your question been answered, or not, so other
can refer to it.
Thank you and Good luck



"Greg" wrote:

I have multiple records with multiple barrels and multiple dates. How can I
limit the records appearing in my report (from a Query) to one record with
the most recent date? Thank you! Greg

  #3  
Old November 18th, 2005, 01:12 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default How can I limit records in my report to the most recent date?

On Thu, 17 Nov 2005 16:55:02 -0800, Greg wrote:

I have multiple records with multiple barrels and multiple dates. How can I
limit the records appearing in my report (from a Query) to one record with
the most recent date? Thank you! Greg


Set the Filter property of the report to:
[DateField] = DMax("[DateField]","QueryName")
Set the Report's FilterOn property to Yes.

Or..
Create another query based upon your current query.
Set the datefield's criteria to
DMax("[DateField]","QueryName")

Use this new query as the report recordsource.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #4  
Old November 18th, 2005, 06:11 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default How can I limit records in my report to the most recent date?

Thank you both very much for your quick and illuminating responses!

I had some trouble implementing the response from Ofer that recommended the
use of "Top1". When I used fredg's advice, I was able to reduce my report to
one record, the most recent. But upon rereading my question I realize I
didn't describe it accurately.

I have some 90 entries in my query coming from two tables. I want my report
to use the query proceeds to group only the most recent entry for each of 23
barrels, with most of them having different "recent/last" dates.

Thank you again. Greg

"Greg" wrote:

I have multiple records with multiple barrels and multiple dates. How can I
limit the records appearing in my report (from a Query) to one record with
the most recent date? Thank you! Greg

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reporting subreport total on main report BobV Setting Up & Running Reports 22 November 1st, 2005 03:19 AM
Need to select a certain X records after a query in access ab Running & Setting Up Queries 17 October 11th, 2005 03:05 PM
Copy Cat Ain't Working shep Setting Up & Running Reports 15 September 12th, 2005 05:14 PM
Reports with Date Range - Errors jwr Setting Up & Running Reports 12 August 8th, 2005 12:57 PM
How can I filter for the most recent date for each set of records. lizbee Running & Setting Up Queries 1 October 22nd, 2004 07:57 PM


All times are GMT +1. The time now is 10:54 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.