1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Select @variable('Date VL souhaitée (format JJ/MM/AAAA) :') "Date de VL souhaitee",
@variable('Type d''offre à fenêtre souhaité (plusieurs choix possibles) :') "Type d'offre à fenêtre",
t2.cport "Portefeuille",
t3.cval "Valeur",
t1.dtvali "Date de valeur liquidative",
t1.stockuc_a "Stock UC Actif en nb de parts",
t1.stockuc_p "Stock UC Passif en nb de parts",
t1.aruc "Avance-Retard en UC-nb parts",
t1.vln "Valeur Liquidative Nette en ",
t1.cmttgp "Cumul Gains-Pertes en ",
(t1.stockuc_a*t1.vln) "Actif valorise en ",
(t1.stockuc_p*t1.vln) "Passif valorise en ",
((t1.stockuc_a*t1.vln)-(t1.stockuc_p*t1.vln)) "Sur-sous Invest. en ",
100*DECODE((t1.stockuc_p*t1.vln),0,0,(((t1.stockuc_a*t1.vln)-(t1.stockuc_p*t1.vln))/(t1.stockuc_p*t1.vln))) "Sur-sous Invest. en %",
t1.dti "Date d'integration"
from GAINPERTE t1, portgfm t2, regroupcval t3, valgfm t5
where t1.id_port = t2.id_port
and t1.id_regroupcval = t3.id_regroupcval
and t3.cval = t5.cval
and (t1.stockuc_p <> 0 OR t1.stockuc_a <> 0 or t1.varuc_a <>0 or t1.varuc_p <>0 )
and t1.dtvali = (SELECT max(t4.dtvali) from GAINPERTE t4 where
t4.id_port = t1.id_port and t4.id_regroupcval = t1.id_regroupcval and t4.dtvali <= @prompt('Date VL souhaitée (format JJ/MM/AAAA) :','A',,mono,free))
and (t5.oaf IN @prompt('Type d''offre à fenêtre souhaité (plusieurs choix possibles) :', 'A',{'PERM','OAT','OAF','ACTION'},multi,CONSTRAINED))
order by t2.cport, t3.cval |
Partager