diff --git a/koku/masu/database/trino_sql/reporting_ocpawscostlineitem_daily_summary.sql b/koku/masu/database/trino_sql/reporting_ocpawscostlineitem_daily_summary.sql index 30b37611ad..e0d38b78e4 100644 --- a/koku/masu/database/trino_sql/reporting_ocpawscostlineitem_daily_summary.sql +++ b/koku/masu/database/trino_sql/reporting_ocpawscostlineitem_daily_summary.sql @@ -753,7 +753,8 @@ WITH cte_total_pv_capacity as ( AND strpos(aws.resource_id, ocp.csi_volume_handle) > 0 AND ocp.csi_volume_handle is not null AND ocp.csi_volume_handle != '' - WHERE ocp.year = {{year}} + WHERE ocp.source = {{ocp_source_uuid}} + AND ocp.year = {{year}} AND lpad(ocp.month, 2, '0') = {{month}} AND ocp.usage_start >= {{start_date}} AND ocp.usage_start < date_add('day', 1, {{end_date}}) diff --git a/koku/masu/database/trino_sql/reporting_ocpazurecostlineitem_daily_summary.sql b/koku/masu/database/trino_sql/reporting_ocpazurecostlineitem_daily_summary.sql index 374eeec9fe..3334947b70 100644 --- a/koku/masu/database/trino_sql/reporting_ocpazurecostlineitem_daily_summary.sql +++ b/koku/masu/database/trino_sql/reporting_ocpazurecostlineitem_daily_summary.sql @@ -508,7 +508,8 @@ WITH cte_total_pv_capacity as ( OR (lower(ocp.csi_volume_handle) = lower(azure.resource_id)) ) - WHERE ocp.year = {{year}} + WHERE ocp.source = {{ocp_source_uuid}} + AND ocp.year = {{year}} AND lpad(ocp.month, 2, '0') = {{month}} AND ocp.usage_start >= {{start_date}} AND ocp.usage_start < date_add('day', 1, {{end_date}})