aboutsummaryrefslogtreecommitdiffstats
path: root/sql/dawn.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/dawn.sql')
-rw-r--r--sql/dawn.sql9
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index 0e6db83c..6fb969fe 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -1337,21 +1337,22 @@ IF strat IS NOT NULL THEN
ELSE
and_clause := '';
END IF;
-IF p_fund = 'SERCGMAST' THEN
+IF p_fund = 'SERCGMAST' OR p_fund = 'BOWDST' THEN
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,
+ fund,
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
+ GROUP BY date, fund, a.security_id, a.maturity HAVING date=$1 AND fund=$3) b
USING (security_id, maturity)', and_clause);
-ELSIF p_fund = 'BOWDST' THEN
-sqlquery := 'SELECT a.*, bowdst_index.admin_clean_nav, bowdst_index.admin_notional FROM list_cds_marks_pre($1, $2, $3) a LEFT JOIN bowdst_index USING (p_index, p_series, maturity) WHERE as_of_date=$1';
+-- ELSIF p_fund = 'BOWDST' THEN
+-- sqlquery := 'SELECT a.*, bowdst_index.admin_clean_nav, bowdst_index.admin_notional FROM list_cds_marks_pre($1, $2, $3) a LEFT JOIN bowdst_index USING (p_index, p_series, maturity) WHERE as_of_date=$1';
ELSIF p_fund = 'BRINKER' THEN
sqlquery := 'SELECT *, 0::double precision, 0::double precision FROM list_cds_marks_pre($1, $2, $3)';
END IF;