Looker Studio is now called Data Studio. Learn more about this change.

DATE_DIFF

Calculates the number of days between two compatibility mode dates.

Sample usage

DATE_DIFF(End Date, Start Date)

Syntax

DATE_DIFF( X, Y )

Parameters

  • X - a date field or date expression.
  • Y - a date field or date expression.

Notes

DATE_DIFF calculates X - Y. If X > Y, the result is positive, otherwise the result is negative.

Examples

Example formula Input Output
DATE_DIFF(End Date, Start Date)
  • End Date : Sep 28 2019
  • Start Date : Sep 10 2019
18
DATE_DIFF(End Date, Start Date)
  • End Date : Sep 9 2019
  • Start Date : Sep 10 2019
-1

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026年08月26日 UTC.