Creating a date list from several date/time fields

I’ve searched the forums but can’t seem to find an answer to what should be a simple issue.

I have a form with a bunch of separate date fields. I want to take the values and turn them into a date list, so they can be stored in a single multivalue date field. I’ve set the multivalue date field to be computed, and set the value to be a list of the dates, but it keeps giving me “incorrect data type for operator or @Function: time/date expected”.

Each of the individual values is a valid date field, so I’m not sure what the problem is. I’ve also tried explicitly forcing it, by using @TextToTime around the list, but still get the error.

@TextToTime(taskPlanStartDate : taskPlanEndDate : taskDevelopStartDate : taskDevelopEndDate : taskExecuteStartDate : taskExecuteEndDate)

I finally got it to not return an error by doing this:

@Explode(@TextToTime(@Text(taskPlanStartDate) + “;” + @Text(taskPlanEndDate) + “;” + @Text(taskDevelopStartDate) + “;” + @Text(taskDevelopEndDate) + “;” + @Text(taskExecuteStartDate) + “;” + @Text(taskExecuteEndDate)); “;”)

However, it now displays only the first value in the list (taskPlanStartDate). Any ideas? I’d prefer to do this in formula in the field value, rather than having to use script.

Subject: Try your first one slightly different:

@TextToTime(@Trim(@Text(taskPlanStartDate : taskPlanEndDate : taskDevelopStartDate : taskDevelopEndDate : taskExecuteStartDate : taskExecuteEndDate)))

This last one does not work because your @Explode was after your @TextToTime:

@Explode(@TextToTime(@Text(taskPlanStartDate) + “;” + @Text(taskPlanEndDate) + “;” + @Text(taskDevelopStartDate) + “;” + @Text(taskDevelopEndDate) + “;” + @Text(taskExecuteStartDate) + “;” + @Text(taskExecuteEndDate)); “;”)

Goes to @Explode(@TextToTime("11/07/2004;11/15/2004;…))

and should be @TextToTime(@Explode("11/07/2004;11/15/2004;…))

Subject: Lemme ask the obvious

Are any of the fields empty, causing the list concatenation operator to become upset when it sees an empty field (text) on one side of it, and a date-time on the other?

If so, one of the following might do:

@iferror(taskPlanStartDate : taskPlanEndDate : taskDevelopStartDate : taskDevelopEndDate : taskExecuteStartDate : taskExecuteEndDate)

or

@texttotime(@trim(@text(taskPlanStartDate) : @text(taskPlanEndDate) : @text(taskDevelopStartDate) : @text(taskDevelopEndDate) : @text(taskExecuteStartDate) : @text(taskExecuteEndDate)))

Subject: RE: Lemme ask the obvious

No, none of the fields are empty. I did end up getting it to work by using two fields:

the first one is a multivalue text field called calendarDates, and the formula is

@Trim(

@If(taskPlanStartDate = “”; “” ; @Text(taskPlanStartDate)) :

@If(taskPlanEndDate = “”; “” ; @Text(taskPlanEndDate)) :

@If(taskDevelopStartDate = “”; “” ; @Text(taskDevelopStartDate)) :

@If(taskDevelopEndDate = “”; “” ; @Text(taskDevelopEndDate)):

@If(taskExecuteStartDate = “”; “” ; @Text(taskExecuteStartDate)) :

@If(taskExecuteEndDate = “”; “” ; @Text(taskExecuteEndDate) ))

(I put the tests in for blank values to prevent future trouble, not because any of the values are blank in my test data.)

The second field is a multivalue date field, and the formula is

@TextToTime(calendarDates)