Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Crystal Report group on max date

Posted on 2014-12-29
7
Medium Priority
?
490 Views
Last Modified: 2014-12-30
In Crystal Report XI R2 I have a main report and in it I  have sub report.  In sub report I have next fields:  
- Student_ ID ,
- Student _Action_ Date,
- Note_ Date
- Note.
One student could have on one student Action Date several notes , each note has its note date.
So I need to pull out one field (Note).

Note for each student on Latest Action date that has latest Note_Date (Date time) value.
I assume that I should make two groups First group :  Studen_ID  (this is link field with main report) , Second group :Student _Action _Date. Somehow I need max Student _Action_Date and Max Note_Date.
How to arrange selection criteria to get this result?
0
Comment
Question by:Taras
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 

Author Comment

by:Taras
ID: 40522590
??
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 1600 total points
ID: 40523078
You cannot group on the max date since it would be calculated after the grouping is done.

Are you trying to just show the name and last action and last note for that action for a given person?
If so you can group on the person then sort by the action date descending and the note date descending.

Put the information in the group header and suppress the details

mlmcc
0
 

Author Comment

by:Taras
ID: 40523105
Hi mlmcc
Yes I am trying to do that. I need just to show field “Note”. It means I need to pass this value in main report. I know how to do this by shared variable. That is not problem.
However.
It is clear what you are saying about group on person then sort by action date descending and note date descending,  but I am not sure what you mean when you said "put the information in group header".
Which information, which field? Do you mean “Note” or something else to put in group header.
0
Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

 
LVL 101

Expert Comment

by:mlmcc
ID: 40523169
The infrmation you wish to show.

mlmcc
0
 
LVL 35

Assisted Solution

by:James0628
James0628 earned 400 total points
ID: 40523391
mlmcc is talking about a situation where you are just displaying the data in a report (or subreport).  If you already have a group on Student _Action _Date, then you just need to have that group sort descending, and then add a sort on Note_Date, also descending.  Then if you put the Note field in the Student_ ID group header, you will only see the note from the first record in the group, which will be the one with the latest Student _Action _Date and Note_Date.

 But it sounds like instead of just displaying the note, you're reading this data in a subreport, and you want to pass the note back to the main report in a shared variable.  In that case, you would just sort the records in the subreport as described, and then set your shared variable in the Student_ ID group header.

 James
0
 

Author Closing Comment

by:Taras
ID: 40524619
Thanks both for help and explanation what is happening.
0
 
LVL 35

Expert Comment

by:James0628
ID: 40524759
You're welcome.  Glad I could help.

 James
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question