DATESUBDATE - Returning the Time Interval Between Two Dates

  • Last update:December 20, 2024
  • Overview

    Syntax

    DATESUBDATE(Date1,Date2,Op)

    Returns the time interval between two dates.

    Parameter 1

    Date1

    The Date1 and Date2 parameters specify the two dates to be entered. If the value of Date1 is earlier than   that of Date2, a negative value is returned. If the value of Date1 is later than that of Date2, a positive value is returned. If the values of Date1 and Date2 are of the numeric types, the serial number logic of the 1990 date system will be followed. For example, the serial number 35796 represents January 1, 1998.

    iconNote:
    The Date1 and Date2 parameters can only be of the text or date types for the real-time data.

    Parameter 2

    Date2

    Parameter 3

    Op

    The Op parameter specifies the time unit of the returned value.

    The options for the unit include s/S (second), m/M (minute), h/H (hour), d/D (day), and w/W (week).

    Notes

    • For the extracted data, the function supports three parameters, among which the first two are of the date or text types and the third is of the text type as required. The third parameter is case-insensitive and can be s/S, m/M, h/H, d/D, or w/W.

    • For the real-time data, the function supports three parameters, among which the first two are of the date or text type and the third is of the text type.

    Example One

    Formula
    ResultNote

    DATESUBDATE("2008-08-08","2008-06-06","h")

    1512


    DATESUBDATE("2008-06-06","2008-08-08","H")

    –1512


    Example Two

    You want to calculate the time interval between two date fields, for example, the time interval between the Registration Time and Contract Signing Time fields. Click the xxx icon, click Add Calculation Field, and enter DATESUBDATE(Registration Time,Contract Signing Time,"D") to calculate the time interval between the two date fields, as shown in the following figure.

    1.png2.png

    附件列表


    主题: Advanced Data Analysis
    Previous
    Next
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy