From 6aa2c1aee36f8e514125f17a04dcd73b2ea80839 Mon Sep 17 00:00:00 2001 From: Richard Croker Date: Tue, 10 Dec 2024 10:39:26 +0000 Subject: [PATCH] Update raw_prescribing_normalised.sql Replace `PARSE_DATETIME` with `PARSE_TIMESTAMP` to get timestamp, in line with other views and tables --- .../commands/measure_sql/raw_prescribing_normalised.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openprescribing/frontend/management/commands/measure_sql/raw_prescribing_normalised.sql b/openprescribing/frontend/management/commands/measure_sql/raw_prescribing_normalised.sql index 2aeb320d2b..afffb74fe8 100644 --- a/openprescribing/frontend/management/commands/measure_sql/raw_prescribing_normalised.sql +++ b/openprescribing/frontend/management/commands/measure_sql/raw_prescribing_normalised.sql @@ -12,7 +12,7 @@ SELECT raw_prescribing.ACTUAL_COST AS actual_cost, raw_prescribing.QUANTITY AS quantity_per_item, raw_prescribing.TOTAL_QUANTITY AS total_quantity, - PARSE_DATETIME("%F", REGEXP_REPLACE(raw_prescribing._FILE_NAME, "^.+/(20\\d\\d)_(\\d\\d)/[^/]+$", "\\1-\\2-01")) AS month + PARSE_TIMESTAMP("%F", REGEXP_REPLACE(raw_prescribing._FILE_NAME, "^.+/(20\\d\\d)_(\\d\\d)/[^/]+$", "\\1-\\2-01")) AS month FROM {project}.{hscic}.raw_prescribing_v2 AS raw_prescribing LEFT JOIN