Print Page | Close Window

trouble with group summaries

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=202
Printed Date: 02 May 2025 at 12:09pm


Topic: trouble with group summaries
Posted By: scottaherbst
Subject: trouble with group summaries
Date Posted: 07 Feb 2007 at 3:46pm
I have a report that looks like this
 I've put my group summary in bold underline
 
 
 
Program Start Date                 Rating Date                        Rating Score
                                                      12/22/06                                       
5/22/06
4/17/05                                          12/22/06                              3
4/17/05                                          6/15/06                                5
4/17/05                                          4/17/05                                2
 
Here's what I've done so far.  I used a summary field and put it in the group heading to show the most recent rating date (by using the maximum function).  What I now want to do is include the rating score that corresponds to that date.  Any ideas?



Replies:
Posted By: BrianBischof
Date Posted: 07 Feb 2007 at 5:55pm
I have to deal with this all the time in my software apps, but I do it using a SQL statement. You might be able to work it into Crystal Reports somehow (I haven't thought about it in that way). Maybe make it a stored procedure and link it to your primary table? Here is a generic SQL statement using Max() that I use and should help get you started.

Select * From Table AS t0
WHERE t0.RatingDate =
(SELECT Max(t1.RatingDate)
FROM Table as t1
WHERE t0.ProgramId=t1.ProgramId)


If you want to stick with running totals, can you put the summary line at the end of the detail lines? If so, create a function which checks if the current date equals the Max date and if so, save the rating score in a variable. Then display that variable in the group footer.



-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window