aboutsummaryrefslogtreecommitdiffstats
path: root/sql/dawn.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/dawn.sql')
-rw-r--r--sql/dawn.sql2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index b7f4c3d1..3df6427c 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -1821,7 +1821,7 @@ LEFT JOIN index_desc c ON a.security_id=redindexcode AND a.maturity=c.maturity
LEFT JOIN (SELECT * FROM index_quotes WHERE date=p_date) d USING (index, series, tenor)
LEFT JOIN valuation_reports ON NULLIF(substring(invid FROM '\D{3}[0]*(\d*)K'), '')::integer = a.globeop_id
LEFT JOIN bowdst_val ON link_ref = a.dealid AND as_of_date=p_date
-LEFT JOIN isosel_accrued ON a.dealid=isosel_accrued.init_fix_id
+LEFT JOIN isosel_accrued ON a.dealid=isosel_accrued.init_fix_id AND period_end_date=p_date
LEFT JOIN (SELECT dealid, SUM(termination_amount) AS terminated_amount
FROM terminations WHERE termination_date <= p_date GROUP BY dealid) e USING (dealid)
LEFT JOIN external_marks_deriv f ON identifier=cpty_id AND f.date=p_date