cancel
Showing results for 
Search instead for 
Did you mean: 

Question about sort technique

Former Member
0 Kudos

we have a report that shows a list of contacts and we have an sub-report that displays (1) one field max(history completed date) so we can see that last time the contact was talked to. The issue is: if we want to have a sort parameter sorts on the max(history completed date) field. How would we do this?

1) pass the field value from the sub-report to the main report?

2) don't created a sub-report, create field value in the main report using sql

Please comment on the approaches above or any other methods that I might not have thought of.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Better yet, here's a sample of what your query should look like.

Insert it into 'Add Command'


select contact_names,
(select max(lasttime) from time.table b where a.contactID=b.contactID)
from table.contacts a

Enjoy,

Zack H.

Answers (1)

Answers (1)

Former Member
0 Kudos

You can't do a sort based on a shared variable from the subreport.

You will need to create a sql statement that brings the max date into your query.

You can use the 'Add Command' feature in Crystal.

I hope this helps,

Regards,

Zack H.