Hi All - I've been stumped on this problem for a while. I can solve it using 2 SQL COMMANDS, but the performance is horrendous, so I'm hoping someone here can give me some pointers on how to get what I'm looking for. Here is a sample of the data I'm working with:
Table1: Summary
Acct PO Expend Allot
1000-1 PO1 100 125
Table2: Detail
Acct PO Contract Expend
1000-1 PO1 C01 50
1000-1 PO1 C02 25
1000-1 PO1 C03 25
Groups
Group1 Account
Group2 PO
Group3 Contract
Detail
My intended output would be similar to following:
GH1:
Expend = 100 Allot = 125
GF3:
Contract C01 PO1 Expend = 50
Contract C02 PO1 Expend = 25
Contract C03 PO1 Expend = 25
I've also got a SubReport placed in the DETAIL section that drills-down to the individual Vouchers assocaiated with the Contracts.
My problem is that I'm trying to summarize the Expend and Allot amounts in the Group Header for Account. Since Allot doesn't exist in the Detail Table, I get multiple records when I join on Account & PO. I can use a RT to get the correct amount in the Group Footer, but can't use in the Group Header. I've also tried a Subreport, but I need to link to the existing Sub-Report (i.e. Voucher) from both Table1 and Table2, so can't have another subreport.
Any help on this issue would be greatly appreciated. I'm using Crystal 10 off a Sybase Server. Let me know if I need to provide more info.
THANKS!
-Ed
Table1: Summary
Acct PO Expend Allot
1000-1 PO1 100 125
Table2: Detail
Acct PO Contract Expend
1000-1 PO1 C01 50
1000-1 PO1 C02 25
1000-1 PO1 C03 25
Groups
Group1 Account
Group2 PO
Group3 Contract
Detail
My intended output would be similar to following:
GH1:
Expend = 100 Allot = 125
GF3:
Contract C01 PO1 Expend = 50
Contract C02 PO1 Expend = 25
Contract C03 PO1 Expend = 25
I've also got a SubReport placed in the DETAIL section that drills-down to the individual Vouchers assocaiated with the Contracts.
My problem is that I'm trying to summarize the Expend and Allot amounts in the Group Header for Account. Since Allot doesn't exist in the Detail Table, I get multiple records when I join on Account & PO. I can use a RT to get the correct amount in the Group Footer, but can't use in the Group Header. I've also tried a Subreport, but I need to link to the existing Sub-Report (i.e. Voucher) from both Table1 and Table2, so can't have another subreport.
Any help on this issue would be greatly appreciated. I'm using Crystal 10 off a Sybase Server. Let me know if I need to provide more info.
THANKS!
-Ed