Hello,
I am running a report using SQL Server 2000 and and inquiry has been created which is running from Crystall Reports 11. To be honest I am not so good at this. Is there anyway to improve the query below? The purpose is to get the cumulative cash flows of a deal from the very beginning to the reporting end date. But the way I have it it takes a very long time to bring back the data in the report. It only ends up being 2 pages of data so my thinking is it is the query I have created....
==========================================
select d.deal_no, acr.acrl_en_dt, sum(cf.amount)as CumulativeCflows from
deals d, cflows cf, acrlrpt acr where
(d.deal_no=acr.deal_no and
cf.deal_no=acr.deal_no and
cf.comments in ('COUPON', 'INTEREST') and
cf.cflow_dt>=d.deal_dt and cf.cflow_dt<= acr.acrl_en_dt and
acr.acc_type in ('COUP', 'INTR'))
group by
d.deal_no, acr.acrl_en_dt
============================================
Any help would be much appreciated!
Thanks a lot!
Joe
I am running a report using SQL Server 2000 and and inquiry has been created which is running from Crystall Reports 11. To be honest I am not so good at this. Is there anyway to improve the query below? The purpose is to get the cumulative cash flows of a deal from the very beginning to the reporting end date. But the way I have it it takes a very long time to bring back the data in the report. It only ends up being 2 pages of data so my thinking is it is the query I have created....
==========================================
select d.deal_no, acr.acrl_en_dt, sum(cf.amount)as CumulativeCflows from
deals d, cflows cf, acrlrpt acr where
(d.deal_no=acr.deal_no and
cf.deal_no=acr.deal_no and
cf.comments in ('COUPON', 'INTEREST') and
cf.cflow_dt>=d.deal_dt and cf.cflow_dt<= acr.acrl_en_dt and
acr.acc_type in ('COUP', 'INTR'))
group by
d.deal_no, acr.acrl_en_dt
============================================
Any help would be much appreciated!
Thanks a lot!
Joe