Skip to content

Conversation

fivetran-BradfordPaskewitz
Copy link
Collaborator

Documentation: https://docs.snowflake.com/en/sql-reference/functions/datediff

Platform Support:
Platform | Supported | Argument Type | Return Type
Snowflake | Yes | date_or_time_part,timestamp_expr1,timestamp_expr2(unit, start, end as date/timestamp) | Integer
BigQuery | Yes | For DATE:DATE_DIFF(date1, date2, INT64), for DATETIME:DATETIME_DIFF(datetime1, datetime2, part) | Integer
Redshift | Yes | DATEDIFF(datepart, startdate, enddate)(unit, start, end as date/timestamp) | BIGINT
PostgreSQL | No * | Not directly; use subtraction:date2 - date1orAGE(date1, date2) | Interval
Databricks | Yes | datediff(endDate, startDate)(supports date, timestamp arguments) | Integer
DuckDB | Yes | date_diff(unit, date1, date2)or direct subtraction for days | Integer/Interval
TSQL (SQL Server) | Yes | DATEDIFF(datepart, startdate, enddate)(unit, start, end as date/datetime/timestamp) | Integer

@geooo109 geooo109 merged commit 2bc05cf into main Oct 14, 2025
7 checks passed
@geooo109 geooo109 deleted the brad/snowflake_datediff branch October 14, 2025 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants