Working with list of Date fields

I’m trying to report on six date fields on a form. In some cases not all fields are used. I need to get the field values that aren’t blank and then find the highest value (newest date). I’m trying to use formula language @Trim(date1 : date2 :date3…) but I’m getting an error date/time expected if any fields are blank. Is there a better way to do this?

Thanks

Subject: Working with list of Date fields

although not stated in help, @Max works with dates as well as numbers.

dates := “01/02/2007” : “12/31/2006” : “11/30/2006” : “11/30/2007” : “07/02/1967”;

big := @Max(@TextToTime(dates));

@Prompt([Ok]; “”; @Text(big))

Subject: RE: Working with list of Date fields

Thanks to both of you!

Subject: Working with list of Date fields

Not elegant but it works (coded for 4 date fields):

TmpDate1 := @If(Date1 = “”; “”; Date1);

TmpDate2 := @If(Date2 = “”; “”; Date2);

TmpDate3 := @If(Date3 = “”; “”; Date3);

TmpDate4 := @If(Date4 = “”; “”; Date4);

DateList := @Trim(@Text(TmpDate1) : @Text(TmpDate2) : @Text(TmpDate3) : @Text(TmpDate4));

@Subset(@Text(@Sort(@TextToTime(DateList); [DESCENDING])); 1)