Problems with maximum aggregation

I have a table billings and a table receipts with a one-to-many relationship. Since there can be many receipts for each bill, I want to make a calculation field in billing that will show the last receipt payment date.

In receipt, I have an aggregation field cLastPayDate as the maximum of the receipt table field datepaid
In billing file I have a calculation datetime field called cLastPaidDate defined as return billing_to_receipts.cLastPayDate;
Is this the right way to do this? The field in the
billing table is blank for all records.

What happens if you show the field in the/a receipt form. Is the value correct there?

Can you post the calculation you made?

No, the field in receipts table is blank.
calc used in billing table is:

var lastdate=billing_to_receipts.cLastPayDate
return lastdate;

.
All of the other calculation fields in billing calculate correctly.

Maybe you can check the ‘maximum’ aggregation with a number or integer value to see if/how it works?

Could be a bug or could be that date aggregations don’t work this way?

Bug confirmed, will be fixed in Servoy 2.0 rc5

Thanks Jan!