I need to make some aggregates using TClientdataset. In SQL these aggregates can be done with script like this :
Select Sum(column1) from table1 where Date_Column < Date_Value
Because I need more speed during a very long process and a very slow network, I want to use in-memory aggregates instead of using sql . My idea is to add an aggregate to the ClientDataset with Expression like this:
Sum(column1)
And make Date_Column index, then filter the clientdataset like this:
myClientdataset.SetRang([value1],[value2]);
I was expecting to see the aggregate result of this range, but, unfortunately the aggregate ignore the range and keep giving the result of all records!
So, my question is: how I can achieve this in TClientdataset? Or, do you have any other idea how to do ranged-aggregates in memory?