Date Difference Custom Value also known as the DATEDIFF() in SQL allows you to calculate the difference between 2 date fields and express the difference into a specific time unit of your choice.
This can be a calculation between either;
- 2 existing date fields from a Selected Data Extension
- A timestamp and an existing date field from a Selected Data Extension (and vice versa)
Watch this video to learn more about Date Difference Custom Value.
How to create a Date Difference Custom Value?
- Go to Custom Values section > Add new value button
- Provide a name for the Custom Value > Apply formula to a field > Click Next > Date Difference > Click Next
- Select either the date fields or the timestamp that you want to calculate
- Select the time unit you want to express the difference in
Save and drag-and-drop the new Custom Value to the Target Data Extension fields
You have a Data Extension (Orders) that contains a column with Order Dates and you want to add a new field to your Target Data Extension that calculates the number of days between the Order Date and the current date.
Follow these step-by-step instructions to achieve this.
You can also create reusable Custom Values. Follow this link to learn how to create reusable Custom Values.