Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Crystal Report group on max date

Posted on 2014-12-29
7
Medium Priority
?
508 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
  • 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
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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 Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

782 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