Board index » delphi » Sort on calculated field

Sort on calculated field

Can a TClientDataSet sort on a calculated field?  I get an "Index out of
range" error when I try to set the IndexFieldNames property to the name of a
calculated field.  Basically, I bring back a string field, but need to sort
on the uppercase of that field's values.  Don't want to do the Upper in SQL
and bring back extra data for the sake of network efficiency.

Thanks,
Andrew

 

Re:Sort on calculated field


I don't think this can be done. You'll have to resort to creating the
field in the SQL statement and sorting on that.
Quote
Andrew Tumpach wrote:

> Can a TClientDataSet sort on a calculated field?  I get an "Index out of
> range" error when I try to set the IndexFieldNames property to the name of a
> calculated field.  Basically, I bring back a string field, but need to sort
> on the uppercase of that field's values.  Don't want to do the Upper in SQL
> and bring back extra data for the sake of network efficiency.

> Thanks,
> Andrew

Re:Sort on calculated field


Andrew,

   If your wanting to sort from within a grid (user clicking on the desired
column), check out ExpressGrid.  It has column sorting (ascending and
descending) built-in.

http://www.devexpress.com

Good luck,
krf

Quote
Andrew Tumpach wrote in message <7onboa$80...@forums.borland.com>...
>Can a TClientDataSet sort on a calculated field?  I get an "Index out of
>range" error when I try to set the IndexFieldNames property to the name of
a
>calculated field.  Basically, I bring back a string field, but need to sort
>on the uppercase of that field's values.  Don't want to do the Upper in SQL
>and bring back extra data for the sake of network efficiency.

>Thanks,
>Andrew

Other Threads