Solved

Crystal Report group on max date

Posted on 2014-12-29
7
449 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
Comment Utility
??
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 400 total points
Comment Utility
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
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
The infrmation you wish to show.

mlmcc
0
 
LVL 34

Assisted Solution

by:James0628
James0628 earned 100 total points
Comment Utility
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
Comment Utility
Thanks both for help and explanation what is happening.
0
 
LVL 34

Expert Comment

by:James0628
Comment Utility
You're welcome.  Glad I could help.

 James
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

743 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

19 Experts available now in Live!

Get 1:1 Help Now