diff --git a/models/br_mg_belohorizonte_smfa_iptu/br_mg_belohorizonte_smfa_iptu__iptu.sql b/models/br_mg_belohorizonte_smfa_iptu/br_mg_belohorizonte_smfa_iptu__iptu.sql index 67e38bc9..bcad7856 100644 --- a/models/br_mg_belohorizonte_smfa_iptu/br_mg_belohorizonte_smfa_iptu__iptu.sql +++ b/models/br_mg_belohorizonte_smfa_iptu/br_mg_belohorizonte_smfa_iptu__iptu.sql @@ -42,5 +42,5 @@ SAFE_CAST(area_terreno AS FLOAT64) area_terreno, SAFE_CAST(area_construida AS FLOAT64) area_construida FROM basedosdados-dev.br_mg_belohorizonte_smfa_iptu_staging.iptu AS t {% if is_incremental() %} -WHERE (CONCAT(ano,'-', mes)) > (SELECT MAX(CONCAT(ano, '-', mes)) FROM {{ this }} ) +WHERE DATE(CAST(ano AS INT64),CAST(mes AS INT64),1) > (SELECT MAX(DATE(CAST(ano AS INT64),CAST(mes AS INT64),1)) FROM {{ this }} ) {% endif %} \ No newline at end of file