Date fields can now be used in Text Calculations
Date fields can now show correctly as dates (NOT as milliseconds). Date fields can also have a specific format set for them such as dd/mm/yyyy
Previously, if a date field was used in a text equation or a table text equation it would appear as milliseconds
To retain a date format in a text equation you need to change the concatenate equation from just referencing the date field name (e.g. Date Affected) so that is has a date(fieldname) before the field name
To use a date field in a text equation (as shown here) the equation must use date(fieldname) in the equation
The example here shows that date was added to the Text Calculation field (named Summary). This is then referenced by the Table Text Calculation Field and still retains the date format correctly.
If you were performing a table text calculation of the date field (without using a text equation in the table as shown above), then date would need to be added before the field name (as shown here)
Because date was added, the date field "Date Affected" is pulled through correctly into the Table Text Equation. Without "date" added before the field name, the Date Affected would show as milliseconds (as shown in the step below)
An example without "date" being added before the field name shows the "Date Affected" field appearing in milliseconds in the Table Text calculation
In addition to adding date before the date field name so it displays correctly, you can set the format that the date is displayed as
The image here shows the Date Affected field in the "Summary" field Text calculation being displayed as dd-mm-yyyy. This is the default format for dates to be displayed. This text equation would be written as :
concatenate (date(Date Affected), ", ", Family Medical Issue)
The Date Affected field is also being used in the Text Calculation "Summary with date format added". You will notice there is a difference between the ways the dates are displayed in the Summary and the Summary with date format added fields; dd-mm-yyyy and dd/mm/yyy respectively.
To reformat the way the date is displayed, the Text calculation equation needs to have a format added. The "Summary with date formate added" field had to be written with a format dd/mm/yyyy for it to display in that format:
concatenate (date(Date Affected, "dd/mm/yyyy"), ", ", Family Medical Issue)
You can reformat a date field that you use in a Text calculation and Table Text Calculation from the dd-mm-yyyy format (that is the default format for dates in the system) to a different format (as shown in the image above) by adding a format into the equation
The steps above outline how to set up a date field to show in text calculation. Now you can change the format the date is displayed in by adding a format to it.
It can be any one of the formats below, but it must be written like this:
date(Date Field, "format") e.g. date(Date Field, "MM-dd-yy")
This takes the Date field you are referencing and specifies that it will be displayed as a date format, and then it specifies what format it will display as.
date(date field, "dd-MM-yyyy")
date(date field, "MM-dd-yyyy")
date(date field, "dd/MM/yyyy")
date(date field, "MM/dd-yyyy")
date(date field, "dd-MM-yy")
date(date field, "MM-dd-yy")
date(date field, "dd/MM/yy")
date(date field, "MM/dd-yy")