I am having one of those brain explosion days. i know this can done but…
i have a calculated text field that i want to take the value of either numbers or dates. When it calculates as a date the date doesn’t format as dd-MM-YYYY.
I have tried to use utils.dateFormat and various date functions till my head hurts.
Thanks for you reply, i have attached a test file for you to look at.
I have identified the problem but don’t know how to fix it.
if you change the combo box to ‘number’ the yellow field returns the number from the blue number field. if you change the combo box to ‘date’ it should return the date from the blue date field but doesn’t.
the field ‘c_date’ is itself a calculation which adds a number of days to a date which works fine.
the calculation for c_text is:
if (type_test == ‘number’)
{
return number_test;
}
else if (type_test == ‘date’)
{
return utils.dateFormat(c_date, ‘dd-MM-yyyy’);
}
if c_date was a datetime field and not a calculation this works fine as you have already tested, but does not calculate if the c_date is a calculated datetime field.
This is where my problem lies, calculating a date into a text field from an existing calculated date.