Files
ISSSTELEON/Persistance/dbt/macros/dates.sql
T
alberto 781e1ea75a C1a: code only, no comments, no Markdown
The four Markdown files (README.md, tests/fixtures/ados2_items_by_module.md, tools/delivery/README.md, tools/delivery/README.repo.md) live in the outer repo under docs/ISSSTELEON; the delivery scripts no longer produce a README and the ADOS-2 expected values stay in the Python test.
2026-12-01 16:56:14 -06:00

28 lines
751 B
SQL

{% macro days_between(a, b) -%}
{{ return(adapter.dispatch('days_between', 'isssteleon')(a, b)) }}
{%- endmacro %}
{% macro default__days_between(a, b) -%}
(cast({{ b }} as date) - cast({{ a }} as date))
{%- endmacro %}
{% macro sqlite__days_between(a, b) -%}
cast(julianday({{ b }}) - julianday({{ a }}) as integer)
{%- endmacro %}
{% macro add_days(d, n) -%}
{{ return(adapter.dispatch('add_days', 'isssteleon')(d, n)) }}
{%- endmacro %}
{% macro default__add_days(d, n) -%}
(cast({{ d }} as date) + {{ n }})
{%- endmacro %}
{% macro sqlite__add_days(d, n) -%}
date({{ d }}, '+' || ({{ n }}) || ' days')
{%- endmacro %}
{% macro as_of() -%}
'{{ var("as_of", run_started_at.strftime("%Y-%m-%d")) }}'
{%- endmacro %}