From 53e15399fcc34b5934c06b084a7dae528631ce31 Mon Sep 17 00:00:00 2001 From: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> Date: Wed, 3 Apr 2024 10:42:23 -0500 Subject: [PATCH] Apply suggestions from code review --- .../int_quickbooks__general_ledger_date_spine.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/intermediate/int_quickbooks__general_ledger_date_spine.sql b/models/intermediate/int_quickbooks__general_ledger_date_spine.sql index 0da43fc..72a1a2a 100644 --- a/models/intermediate/int_quickbooks__general_ledger_date_spine.sql +++ b/models/intermediate/int_quickbooks__general_ledger_date_spine.sql @@ -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 %} @@ -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 %}