Solved

How do I write the crystal syntax

Posted on 2011-03-23
3
502 Views
Last Modified: 2012-05-11
Hi, I am building a report that is group by a pat_id and lab dates with results for each of the dates.  For example, id#xxxx08 seen on 09/06/2008 with a result of 5.60
                                                                  02/11/2009 with a result of 7.10
                                                                   01/1/2010 result 11.0
I can write the formula to get the max date with this:
maximum({RESULT_DATE},({PAT_ID}) )
which will give me 01/11/2010 but how do I write the formula to pick up the 11.0? (ord_num_value)
0
Comment
Question by:Kathy_O
  • 2
3 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 35201303
There is no easy formula to get it however, if the order of the data isn't important you can sort by the date and then the record in the group header (descending sort) or footer (ascending sort) will have the value.

mlmcc
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 35201332
If you need them in some other order then you could use a set of formulas like

In the group header add a formula
WhilePrintingRecords;
Global DateVar grpMaxDate := maximum({RESULT_DATE},({PAT_ID}) );
""

In the detail section
WhilePrintingRecords;
Global DateVar grpMaxDate;
Global NumberVar ord_num_value;
If {RESULT_DATE} = grpMaxDate then
      ord_num_value := {ord_num_value};
""

In the group footer
WhilePrintingRecords;
Global DateVar grpMaxDate;
Global NumberVar ord_num_value;
ord_num_value

mlmcc
0
 

Author Closing Comment

by:Kathy_O
ID: 35201777
Thanks I thought I could do this by wrapping formulas but this works really nice!!!
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

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 Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

776 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