You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{% do return( tsql_utils.sqlserver__dateadd(datepart, interval, from_date_or_timestamp)) %}
{% endmacro %}
with data as (
select*from"dbtsynapseci"."test"."data_dateadd"
)
select
case
when datepart ='hour' then cast(
dateadd(
hour,
interval_length,
cast(from_time as datetime)
)
as
datetime2
)
when datepart ='day' then cast(
dateadd(
day,
interval_length,
cast(from_time as datetime)
)
as
datetime2
)
when datepart ='month' then cast(
dateadd(
month,
interval_length,
cast(from_time as datetime)
)
as
datetime2
)
when datepart ='year' then cast(
dateadd(
year,
interval_length,
cast(from_time as datetime)
)
as
datetime2
)
else null
end as actual,
result as expected
from data
The text was updated successfully, but these errors were encountered:
for some reason
sqlserver__dateadd
works on Azure SQL, but on Synapse, it comes up short by a day.tsql-utils/macros/dbt_utils/cross_db_utils/dateadd.sql
Lines 1 to 13 in 730fa0d
The text was updated successfully, but these errors were encountered: