---
schema_version: "1"
id: 6689b3ec0f3f177c35a103a3d20297457de9b825bc93d7d96c53eef6ab6e46c9
title: Date Difference
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/analytics/264-0-0/bi_integrate_recipe_duration_between_dates.md
canonical_url: https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_recipe_duration_between_dates.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: d18800a2134b37707e525824b8b15f98fb4a2d3e25e38bf5b370da5ddb1612d8
description: In CRM Analytics, calculate the duration between two selected date columns as days, months, or years.
products:
  - CRM Analytics
  - Cross Cloud
release: "264"
---
# Date Difference

In CRM Analytics, calculate the duration between two selected date columns as days, months, or years.

### Required Editions

## Date Difference

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d98826e39">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d98826e39 ">To create a recipe:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d98826e39 ">Edit CRM Analytics Dataflows OR Edit Dataset Recipes</td>

          </tr>
        </tbody>
      </table>

1. In a Transform node of a Data Prep recipe, select one date column in the Preview tab.
2. Select the Formula button (![Formula button](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/resources-global/analytics/images/bi_integrate_recipe_transformation_formula.png)) in the Transform toolbar.
3. Select **Date Difference**.
4. Configure the transformation.
    
    ![The Duration menu appears when you select Date Difference.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/resources-global/analytics/images/bi_integrate_recipe_duration.png)
    
    1. Start Date is automatically filled with the date column you previously chose. Cancel and restart to choose a different Start Date.
    2. End Date is the value used to calculate the duration from the start date. Choose a date column from your data or the **Now** option to use the current date and time.
    3. Select whether to return duration as days, months, or years. Days are rounded up to the nearest value, while months and years include the selected number of decimal places.
5. Optionally, change the label of the column that stores the result in the Column Label field.
6. Click **Apply** to add the transformation to the Transform node.
    
    The Preview tab shows the new Now column.
    
    ![Preview shows the new Duration column.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/resources-global/analytics/images/bi_integrate_duration_outcome.png)
7. To view the Graph area, click the Collapse button (![Collapse button](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/resources-global/analytics/images/bi_button_collapse.png)).
8. Save the recipe.

After you run the recipe, you can view the calculated duration. The Now option uses the date and time when the recipe last ran, based on UTC timezone.