---
title: Date Difference Custom Value
slug: segment/date-difference-custom-value
docTags: 
createdAt: 2026-01-16T18:04:12.803Z
---

Date Difference Custom Value (also known as the DATEDIFF() in SQL) allows you to calculate the difference between two date fields and express the difference into a specific time unit of your choice.

This can be a calculation between either:

- Two existing date fields from a Selected Data Extension
- A timestamp and an existing date field from a Selected Data Extension (and vice versa)

## Video overview

::embed[]{url="https://vimeo.com/685448660?fl=pl&fe=vl"}

## Create a Date Difference Custom Value

1. Under **Custom Values**, click the **Add new value** button.
2. Provide a name for the Custom Value, select *Apply formula to a field* as **Type**, and click **Next.**

::Image[]{src="https://support.deselect.com/hc/article_attachments/29481207145873" size="50" width="1302" height="1232" isUploading="false" darkWidth="1302" darkHeight="1232" showCaption="false"}

3. Select *Date Difference* as **Type of Formula&#x20;**&#x61;nd click **Next.**

::Image[]{src="https://support.deselect.com/hc/article_attachments/29481207148305" size="50" width="1306" height="1240" isUploading="false" darkWidth="1306" darkHeight="1240" showCaption="false"}

4. Select either the date fields or the timestamp that you want to calculate and the time unit you want to express the difference in.

::Image[]{src="https://support.deselect.com/hc/article_attachments/29481430573585" size="60" width="1314" height="1246" isUploading="false" darkWidth="1314" darkHeight="1246" showCaption="false"}

5\. Click **Save** and move the new Custom Value to the Target Data Extension fields.

