Skip to content

Commit 6d32704

Browse files
authored
Update Parking_interim_cycle_hangar_waiting_list.py
Change to use the 'new' email & telephone number fields in Michael W's data
1 parent 686ab23 commit 6d32704

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

scripts/jobs/parking/Parking_interim_cycle_hangar_waiting_list.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
23/12/2024 - Create SQL
2424
06/01/2025 - add unsubscribed email
2525
13/01/2025 - add opt-in data
26+
21/01/2024 - change to use new telephone & email field in Michael's data
2627
*********************************************************************************/
2728
With Interim_Wait as (
2829
SELECT
@@ -39,6 +40,7 @@
3940
,y
4041
,lat
4142
,long
43+
,telephone
4244
FROM "parking-raw-zone".interim_cycle_wait_list
4345
WHERE import_date = (select max(import_date)
4446
from "parking-raw-zone".interim_cycle_wait_list)),
@@ -84,14 +86,13 @@
8486
from "parking-raw-zone".parking_parking_opt_in_form_responses)
8587
AND please_select_one_of_the_options_below like 'No.%')
8688
89+
/*** 21/01/2025 - Update the selected list to use Michael's data (Telephone & Email)***/
8790
SELECT
88-
A.*, cast(D.telephone_number as varchar) as Telephone_Number, C.address2 as Street, B.housing_estate,
89-
CASE
90-
When length(E.email_address) > 1 Then E.email_address
91-
When length(F.email)> 1 Then F.email
92-
END as email_address,
91+
A.forename, A.surname, A.email, A.party_id_to, A.party_id, A.uprn, A.address1, A.address2,
92+
A.post_code, A.x, A.y, A.lat, A.long, cast(telephone as varchar) as telephone_number,
93+
C.address2 as Street, B.housing_estate, A.email as email_address,
9394
94-
format_datetime(CAST(CURRENT_TIMESTAMP AS timestamp),
95+
format_datetime(CAST(CURRENT_TIMESTAMP AS timestamp),
9596
'yyyy-MM-dd HH:mm:ss') AS import_date_timestamp,
9697
9798
format_datetime(current_date, 'yyyy') AS import_year,

0 commit comments

Comments
 (0)