dataengref migrate

Home / SQL Server

SQL Server DATEFROMPARTS in Snowflake, Databricks and BigQuery

Snowflake has DATE_FROM_PARTS, Databricks has make_date and BigQuery uses DATE(year, month, day). Out-of-range parts behave differently: SQL Server raises an error, Snowflake rolls them over.

SQL Server function: DATEFROMPARTS(year, month, day) · SQL Server docs

Equivalents

TargetSupportSyntaxNotesSource
SnowflakeDifferent nameDATE_FROM_PARTS(year, month, day)Values outside the normal ranges are accepted, for example month 13 becomes January of the next year.Snowflake docs
DatabricksDifferent namemake_date(year, month, day)Invalid dates return NULL or an error depending on ANSI mode.Databricks docs
BigQueryDifferent nameDATE(year, month, day)Invalid dates raise an error.BigQuery docs

Behavior differences to check

Snowflake

Examples

First day of each month

SQL Server
SELECT DATEFROMPARTS(y, m, 1) AS month_start FROM periods;
Snowflake
SELECT DATE_FROM_PARTS(y, m, 1) AS month_start FROM periods;
Databricks
SELECT make_date(y, m, 1) AS month_start FROM periods;
BigQuery
SELECT DATE(y, m, 1) AS month_start FROM periods;

Other SQL Server functions

Last checked: · Paste a whole query into the SQL checker to find every function that needs a change.