Skip to content

Commit bac2239

Browse files
authored
Update parking_cedar_payments.py
add additional date formatting
1 parent 85861eb commit bac2239

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/jobs/parking/parking_cedar_payments.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ def sparkSqlQuery(glueContext, query, mapping, transformation_ctx) -> DynamicFra
6262
SELECT
6363
cc, subj,analysis, trandate,
6464
CASE
65-
When trandate like '%/%'Then CAST(substr(trandate, 7, 4)||'-'||substr(trandate, 4,2)||'-'||'01' as date)
65+
When trandate like '%/%' Then
66+
CAST(substr(trandate, 7, 4)||'-'||substr(trandate, 4,2)||'-'||'01' as date)
67+
When substr(trandate, 1, 4) like '%-%' Then
68+
CAST(substr(trandate, 7, 4)||'-'||substr(trandate, 4,2)||'-'||'01' as date)
6669
ELSE cast(concat(substr(Cast(trandate as varchar(10)),1, 7), '-01') as date)
6770
END as PayMonthYear,
6871
description, o_description, cast(financialvalue as decimal(10,2)) as financialvalue

0 commit comments

Comments
 (0)