diff options
Diffstat (limited to 'sql')
| -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 783f1f66..6f256c54 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -845,9 +845,9 @@ BEGIN ELSE unsettled_opt = ''; END IF; - sqlquery := 'WITH temp AS (SELECT bonds_trades.identifier, asset_class, settle_date, folder, + sqlquery := 'WITH temp AS (SELECT bond_trades.identifier, asset_class, settle_date, folder, principal_payment, accrued_payment, sum(faceamount*(2*buysell::int-1) ) - OVER (PARTITION BY bonds_trades.identifier) notional FROM bonds_trades WHERE trade_date<=$1 + OVER (PARTITION BY bond_trades.identifier) notional FROM bond_trades WHERE trade_date<=$1 AND fund=$3) SELECT DISTINCT ON (temp.identifier) temp.identifier, securities.description, notional, folder, securities.coupon, start_accrued_date, settle_date, temp.principal_payment, |
