Skip to content

Commit

Permalink
start_date and end_date casting fix (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-joemarkiewicz authored Mar 8, 2022
1 parent 861b095 commit ebab03e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions macros/get_metric_sql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ joined as (
bounded as (
select
*,
{% if start_date %} '{{ start_date }}' {% else %} min(case when has_data then period end) over () {% endif %} as lower_bound,
{% if end_date %} '{{ end_date }}' {% else %} max(case when has_data then period end) over () {% endif %} as upper_bound
{% if start_date %}cast('{{ start_date }}' as date){% else %} min(case when has_data then period end) over () {% endif %} as lower_bound,
{% if end_date %}cast('{{ end_date }}' as date){% else %} max(case when has_data then period end) over () {% endif %} as upper_bound
from joined
),

Expand Down

0 comments on commit ebab03e

Please sign in to comment.