spacemanspiffy04
Programmer
Hi,
I use CR XI with DB2.
I am creating a report that has 2 groups as shown below.
One of the fields in this report is a date field. I need to only pick up the latest date from this field for each of the distinct account numbers.
So, for the example below, I want the report to just show account number 123 for date of 11-27 and account number 678 for date 12-02. I do not need the other records pertaining to these account numbers.
Location :A (GROUP 1)
Area: B01 (GROUP 2)
Account # Date User ID Comments
123 11-25 XXXX XXXXXX
123 11-26
123 11-27 (DISPLAY THIS ROW)
678 12-01
678 12-02 (DISPLAY THIS ROW)
I had a similar question for a prior report, where I wanted only the maximum date at the "Area" group level and LBass had a great suggestion of going to :
report->selection formula->GROUP and entering:
{table.date} = maximum({table.date},{@group})
This worked great. However for this report I need to select the maximum date based on account number. I tried creating a group out of account number and using the formula above, and that worked, but then I could not get the sorting I wanted as I now had an unnecessary Account number group.
Any help would be greatly appreciated!!!
Thanks!
I use CR XI with DB2.
I am creating a report that has 2 groups as shown below.
One of the fields in this report is a date field. I need to only pick up the latest date from this field for each of the distinct account numbers.
So, for the example below, I want the report to just show account number 123 for date of 11-27 and account number 678 for date 12-02. I do not need the other records pertaining to these account numbers.
Location :A (GROUP 1)
Area: B01 (GROUP 2)
Account # Date User ID Comments
123 11-25 XXXX XXXXXX
123 11-26
123 11-27 (DISPLAY THIS ROW)
678 12-01
678 12-02 (DISPLAY THIS ROW)
I had a similar question for a prior report, where I wanted only the maximum date at the "Area" group level and LBass had a great suggestion of going to :
report->selection formula->GROUP and entering:
{table.date} = maximum({table.date},{@group})
This worked great. However for this report I need to select the maximum date based on account number. I tried creating a group out of account number and using the formula above, and that worked, but then I could not get the sorting I wanted as I now had an unnecessary Account number group.
Any help would be greatly appreciated!!!
Thanks!