diff options
| -rw-r--r-- | sql/dawn.sql | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql index fcc94328..66c3058c 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -1083,14 +1083,14 @@ IF strat IS NOT NULL THEN ELSE and_clause := ''; END IF; -sqlquery := format('SELECT l.*, b.globeop_nav, b.globeop_notional from list_cds_marks_pre($1, $2, ''SERCGMAST'') l +sqlquery := format('SELECT l.*, b.globeop_nav, b.globeop_notional from list_cds_marks_pre($1, $2, $3) l JOIN (SELECT a.security_id, a.maturity, sum(endbooknav) AS globeop_nav, sum(endqty) AS globeop_notional FROM (SELECT periodenddate as date, endqty, endbooknav, split_part(invid, ''_'', 2) AS security_id, split_part(invid, ''_'', 6)::date AS maturity FROM valuation_reports where invid like ''CDS\_%%'' %s) a GROUP BY date, a.security_id, a.maturity HAVING date=$1) b using (security_id, maturity)', and_clause); -RETURN QUERY EXECUTE sqlquery USING p_date, strat; +RETURN QUERY EXECUTE sqlquery USING p_date, strat, p_fund; end; $$ LANGUAGE plpgsql; |
