change which field we join on: payment date is not always informed
This commit is contained in:
parent
6f625ec7db
commit
d96c8b2abb
1 changed files with 2 additions and 2 deletions
|
|
@ -47,11 +47,11 @@ left join
|
||||||
left join stg_core__payment_status ps on p.id_payment_status = ps.id_payment_status
|
left join stg_core__payment_status ps on p.id_payment_status = ps.id_payment_status
|
||||||
left join
|
left join
|
||||||
int_hardcoded_historical_currency_rates r
|
int_hardcoded_historical_currency_rates r
|
||||||
on p.paid_date_utc = r.rate_date
|
on vtp.payment_due_date_utc = r.rate_date
|
||||||
and p.currency = r.from_currency
|
and p.currency = r.from_currency
|
||||||
and r.to_currency = 'GBP'
|
and r.to_currency = 'GBP'
|
||||||
left join
|
left join
|
||||||
int_simple_exchange_rates nr
|
int_simple_exchange_rates nr
|
||||||
on p.paid_date_utc = nr.rate_date_utc
|
on vtp.payment_due_date_utc = nr.rate_date_utc
|
||||||
and p.currency = nr.from_currency
|
and p.currency = nr.from_currency
|
||||||
and nr.to_currency = 'GBP'
|
and nr.to_currency = 'GBP'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue