Example of Adding a Custom Field to a Report

Dayforce Implementation Guide

Version
R2025.1.1
Example of Adding a Custom Field to a Report

The following example demonstrates the configuration of a report that features a custom field that returns the number of days off in employees' vacation amounts. For the purpose of this example, the Employee Vacation Amounts report is created based on the Time Away From Work report topic. So far, it includes the Display Name, Pay Code, Start Date Time, End Date Time, and Hours fields:

Employee Vacation Amounts report open in the report designer.

To add a custom field called Number of Days Off to the report:

  1. Click Fields > Add Custom Field. The Custom Field Editor opens.
  2. Enter Number of Days Off as the display name and a short description.
  3. Select Integer in the Data Type drop-down list so that the data is returned as a whole number.
  4. Use the DATEDIFF function to create the expression. "DATEDIFF" is an SQL function that returns the count of the specified "datepart" boundaries crossed between the specified "startdate" and "enddate". It uses the following syntax:
  5. DATEDIFF( datepart , startdate, enddate )
  6. Note: See Custom Field Functions Library. More information about the “DATEDIFF” SQL function is available online from Microsoft, at http://technet.microsoft.com/en-us/library/ms189794.aspx
  7. Specify "nn" as the "datepart" so that Dayforce calculates the difference in days.
  8. Insert the Start Date Time field as the "startdate", and the Start End Time field as the "enddate". The following screenshot shows the Custom Field Editor with the necessary expression:
  9. Custom Field Editor dialog box.
  10. Click Validate to check your expression. If your entry isn't valid, Dayforce displays an error message that explains where the error occurred.
  11. When your expression is successfully validated, click Apply. Dayforce displays the report designer with your custom field to the right of all of the other fields on the report, as shown in the screenshot below. You can click and drag it to the desired position.
  12. Employee Vacation Amounts report in the report designer with the Number of Days Off custom field added.