1
votes

I am using Crystal Reports 2008 and trying to get other fields associated with maximum(date,customer).

Data:

customer    orderdate   item
'1'         '1/1/2014'   '87'
'1'     '1/2/2014'    '99'  
'1'     '1/3/2014'    '21'  
'1'     '1/4/2014'    '55'
...

report to show

'Customer' 'maxOrderDate'  'maxOrderDateitem'  'minOrderDate''minOrderdateItem'

I've grouped by customer and have max and min dates in the group header [min date I'm getting by arranging details ascending]. Order data in details sorted ascending. Formula for maximum: maximum(orderDate, customer). Is it even possible to get the other data on that line?

2

2 Answers

1
votes

yes you can get try below formula:

if orderdate=Maximum(orderdate)
then item

Place the above formula after max date and in the same way create for min date

0
votes

Well simply again group by the Date and choose the Ascending or descending order as per your need. In that the look would be: (According to the Group Heirarchy, you can also change the group order)

Customer............................................................
Date...............................................................
//place all other fields here and they will be according to the respective dates.