diff --git a/definitions/staging/stg_agent_status_history_report.sqlx b/definitions/staging/stg_agent_status_history_report.sqlx index a81205c..d55a8b4 100644 --- a/definitions/staging/stg_agent_status_history_report.sqlx +++ b/definitions/staging/stg_agent_status_history_report.sqlx @@ -74,5 +74,5 @@ left join ${ref("stg_MAPPING_AGENT_REASON_CODE_ID")} mrc on ags.REASON_CODE = mrc.REASON_CODE where ags.REASON_CODE <> 'End of Shift' and ags.AGENT_ID <> 400000000081027 -${ when(incremental(), `where date(ags.TIMESTAMP) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY) +${ when(incremental(), `and date(ags.TIMESTAMP) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY) and date(ags.TIMESTAMP) < CURRENT_DATE()`) } \ No newline at end of file