problem:order by sum(quantity*price) desc
notes:
0.SQL is : select article_code, quantity, price from article order by sum(quantity*price) desc
1.I uses DBX, trial fastreport3.06: records always are ascend sequance -->Error
2. the way I get data is : SQLConnection + SQLQuery + DatasetProvider -->
ClientDataSet --> fastreport
3. SQLConnection + SQLQuery + DatasetProvider -->
ClientDataSet --> datasource --> dbgrid, records always are descend sequance
4.order by sum(quantity*price) asc, fr3.06 is right
5.same way with fastreport2.53: records always are descend sequance ->OK
best reguard
0.SQL is : select article_code, quantity, price from article order by sum(quantity*price) desc
1.I uses DBX, trial fastreport3.06: records always are ascend sequance -->Error
2. the way I get data is : SQLConnection + SQLQuery + DatasetProvider -->
ClientDataSet --> fastreport
3. SQLConnection + SQLQuery + DatasetProvider -->
ClientDataSet --> datasource --> dbgrid, records always are descend sequance
4.order by sum(quantity*price) asc, fr3.06 is right
5.same way with fastreport2.53: records always are descend sequance ->OK
best reguard
Comments
first, I love fr2.53, I am evaluating the new fastreport3.x because the fastreport3.xx has a lot of good qualities than fastreport2.53. I hope fr3 has good and stonely version.
I use the below sql clause:
select article_code, sum(quantity) as quantity, price, sum(quantity*price) as amount
from article
group by article_code, price
order by sum(quantity*price) desc
I write the test program with delphi7 and DBX(SQLConnection+SQLQuery(above sql)+DatasetProvider-->ClientDataSet-->datasource-->dbgrid), records are descend sequance.
but, when I get data through SQLConnection+SQLQuery(above sql)+DatasetProvider-->ClientDataSet-->fastreport, fastreport3.0x shows ascend sequence data.
if I get data through ADOConnection+ADOQuery(above sql)+DatasetProvider-->ClientDataSet-->fastreport, fastreport3.0x shows descend sequence data.
if I use fr2.53, fr2.53 shows the descend sequence data through DBX or ADO.
I do not know what's reason to cause above case?
thank you, best regard!