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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grouping show Largest dates 1

Status
Not open for further replies.

needmoremoney

Technical User
Mar 30, 2005
123
0
0
US
Hello I have a report that is grouping the a bunch of dates by companies.

I would like to show only the latest date only. Does any know how to do this.

Example:

123
03/02/04 1:02:00pm 454 John
03/03/04 2:03:00pm 454 John
234
03/24/06 1:02:00pm 232 Abby
03/24/06 1:03:00pm 232 Abby

I like it to look like this:

123
03/03/04 2:03:00pm 454 John
234
03/24/06 1:03:00pm 232 Abby

Thanks ..
 
In the Report-Selection Formulas->Group place:

{table.date} = maximum({table.date},{table.state})

Not sure why you're grouping by the dates, delete that grouping, you only need the State.

-k
 
Here are the fields that I have,

DateTime CompanyNumber EmployeeID EmployeeName

I am grouping by the companynumber.

I wasn't able to get the codes that you offerred working, can you elaborate? Thanks
 
In the Report-Selection Formulas->Group place:

{table.date} = maximum({table.date},{table.company})

And please don't just say that it doesn't work, show what you tried, where you tried it, and if you get an error, post the error, if no error, show what is returned.

-k
 
Whats up buddy. I think I know a way you can do this. I take it that you are grouped by company number, and the dates are in the details so:

1. In the group header (company number) place the formula @nTestIni:


whileprintingrecords;
NumberVar nCnt;

nCnt := 0;

You can look at this initialization of the variable on your report but you are going to want to suppress that formula field on the actual report

2. In the detail section put this formula @nTest:

whileprintingrecords;
NumberVar nCnt;

nCnt := nCnt + 1

You can keep it to preview the count on the report, but suppress it on the final product.

3. Next go to Report=>sort records, and sort by the date/time field descending.

4. Right click on the detail section and click on the x+2 to the right of the suppress (no drill-down) option. Insert this formula:

whileprintingrecords;
NumberVar nCnt;

nCnt <> 1

And that should do it let me know if you have errors. Later dude!

Adam

 
Yo Adam dude.

A similar solution to the one you offer would be to sort by the date ascending and place the date in the group footer, along with all other fields, and then suppress the details and group header.

Does the same thing without variables or a suppression formula.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top