I'm trying to create a crystal report based of an sql server database. My table has the columns Make. and RentCount, and I'm trying to get the total of the RentCount for the rows that have the same Make.
In Sql Server, I can use the query:
SELECT SUM(RentalCount) AS TotalSales
FROM VehicleInventory
WHERE CarMake='Honda'
and it returns a scalar value with the correct sum. However in crystal reports, when I use the sql expression
(SELECT MAX(SUM(RentalCount))
FROM VehicleInventory
WHERE VehicleInventory.CarMake='Honda')
The sum is displayed in 15 rows having the same value. There are 15 rows affected by my WHERE Clause.
()
in the second query? – Ilyes