Solved

Crystal Report group on max date

Posted on 2014-12-29
7
452 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 100

Accepted Solution

by:
mlmcc earned 400 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 100

Expert Comment

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

mlmcc
0
 
LVL 34

Assisted Solution

by:James0628
James0628 earned 100 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 34

Expert Comment

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

 James
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now