how to sum two sql queries total field
Hi...
Report Builder Pro 7
Delphi 7
I have a report with two sql queries included (created with the Designer and
saved as RTM file).
'Query1' prints numbers and, with a DBCalc, a SUM of those numbers.
'Query2' prints another numbers, and with another DBCalc, the sum of those
numbers.
?Is it possible to sum DBCalc1 + DBCalc2 without RAP or code?
?Is it possible to create another query that obtains data from Query1 and
Query2 results?
Thanks!
Report Builder Pro 7
Delphi 7
I have a report with two sql queries included (created with the Designer and
saved as RTM file).
'Query1' prints numbers and, with a DBCalc, a SUM of those numbers.
'Query2' prints another numbers, and with another DBCalc, the sum of those
numbers.
?Is it possible to sum DBCalc1 + DBCalc2 without RAP or code?
?Is it possible to create another query that obtains data from Query1 and
Query2 results?
Thanks!
This discussion has been closed.
Comments
1. Unfortunately there is not a built-in way to calculate the sum of two
DBCalc components without using RAP or Delphi code. I would recommend using
a TppVariable and the OnCalc event to calculate the TppDBCalc1.Value +
TppDBCalc2.Value.
2. Yes... this is definitely possible. This would be especially easy if
you created a query that only contained one field and one record. For
instance if you returned only the sum of the first field plus the sum of the
second field, you could place this value on your report without the need to
connect the dbpipeline to the report. Something like the following...
SELECT SUM(Field1) + SUM(Field2)
FROM Table1
--
Thanks for supporting ReportBuilder! Please vote for ReportBuilder in the
Delphi Informant Readers Choice awards!
http://www.delphizine.com/ballot2004/
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com