Notification

This article is about Looker Studio. For Looker documentation, visit https://cloud.google.com/looker/docs/intro.

Trang bạn đã yêu cầu hiện không có sẵn bằng ngôn ngữ của bạn. Bạn có thể chọn ngôn ngữ khác ở cuối trang hoặc dịch nhanh mọi trang web sang ngôn ngữ mà bạn chọn bằng cách sử dụng tính năng dịch được tích hợp sẵn trong Google Chrome.

DATE_DIFF

Calculate the number of days between two compatibility mode dates.

This function only supports compatibility mode dates. We recommend upgrading any older date fields in your data sources to the new Date or Date & Time types and using the DATETIME_DIFF function instead. Learn more.

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

Related resources

Thông tin này có hữu ích không?

Chúng tôi có thể cải thiện trang này bằng cách nào?
true
What's new in Looker Studio?

Learn about new features and recent changes. Looker Studio release notes live on Google Cloud.

Search
Clear search
Close search
Main menu
8783298917829016986
true
Tìm kiếm trong Trung tâm trợ giúp
true
true
true
true
true
102097
false
false