Skip to content

Commit

Permalink
Add data type casting to enrollment date logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah-tuva committed Nov 14, 2024
1 parent 66aa255 commit 3da0860
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion models/final/eligibility.sql
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ with demographics as (
end as integer) as death_flag
, cast(enrollment.enrollment_start_date as date) as enrollment_start_date
, case
when enrollment.enrollment_end_date >= {{ dbt.current_timestamp() }} then {{ last_day(dbt.current_timestamp(), 'month') }}
when enrollment.enrollment_end_date >= cast({{ dbt.current_timestamp() }} as date)
then {{ last_day(dbt.current_timestamp(), 'month') }}
when enrollment.enrollment_end_date is null then {{ last_day(dbt.current_timestamp(), 'month') }}
else cast(enrollment.enrollment_end_date as date)
end as enrollment_end_date
Expand Down

0 comments on commit 3da0860

Please sign in to comment.