Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-joemarkiewicz authored Apr 3, 2024
1 parent 2310f41 commit 53e1539
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ with spine as (

{% if execute %}
{% set first_date_query %}
select coalesce(min(transaction_date),{{ dbt.dateadd("month", -1, "current_date") }}) as min_date from {{ ref('quickbooks__general_ledger') }}
select coalesce(min(cast(transaction_date as date)),cast({{ dbt.dateadd("month", -1, "current_date") }} as date)) as min_date from {{ ref('quickbooks__general_ledger') }}
{% endset %}
{% set first_date = run_query(first_date_query).columns[0][0]|string %}

Expand All @@ -21,7 +21,7 @@ with spine as (

{% if execute %}
{% set last_date_query %}
select coalesce(max(transaction_date), current_date) as max_date from {{ ref('quickbooks__general_ledger') }}
select coalesce(max(cast(transaction_date as date)), cast(current_date as date)) as max_date from {{ ref('quickbooks__general_ledger') }}
{% endset %}

{% set current_date_query %}
Expand Down

0 comments on commit 53e1539

Please sign in to comment.