Solved

Crystal Report group on max date

Posted on 2014-12-29
7
463 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 
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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
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 video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

820 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