Can I define an {ORDER} clause like the {WHERE} expression in Data Abstract schemas?

My issue is that I have some queries that I want to put ONCE in my Data Abstract Schema, but on the client side,
I want to select ordering by “Delivery Dates” or by “Return Dates” and the client software modes should be set at the client side, but using the same “Tables”?

I first tried to hack it using an ORDER BY {:PARAM} but that doesn’t even work.

I basically need to switch between:
ORDER BY B.dDate,B.rDate
and
ORDER BY B.rDate,B.dDate

Hello,

You could use {ORDERBY} macro in SQL statement for data table. Then use Sorting property of TableRequestInfoV5 (http://wiki.remobjects.com/wiki/TableRequestInfoV5_Class_(Delphi) ). However Sorting allows to use only one field in ORDER BY statement. So in your case it doesn’t suit you.
You should write custom service method for filling data from the server, where you will add necessary ORDER BY statement to SQL.

Best regards

Is it possible that the {ORDERBY} macro and its associated fields could be improved in a future version (TableRequestInfoV6)? The available options seem pretty ugly to me. I’d like to be able to define any arbitrary orderby clause either from the client side, or via an integer parameter from the client leading to a set of choices stored on the schema side.

We will research such possibility, approprite issue was logged as #61397 .

Best regards

Thank you! This would really save me a lot of work. I have a custom 400 line query that needs to be shown grouped by Ship Out date then by Ship In date, and sometimes switched to Ship In date, then by Ship Out date, and in future will have about 8 more sets of dates to order by (Rehearsal Date, Show Start Date, Show End Date, etc).

I support this feature request. Allowing to build an order clause similiar to building the where clause would help me a lot. I have a lot tables where the sort order changes at runtime. At the moment I do this by adding indices and sorting on the fly at client side, but this is a total different approach…

Just wanted to give my +1 vote to this as well. Thanks.

+1 [filler]

+1 [filler]

Hi guys,

Just increased priority for this issue.

Thanks!

+1[filler]

+1 [filler] :smile

Another +1 here, can you bump the priority of this again by any chance? Having an “order builder” similar to the where builder system would be awesomely useful.

Just to add that I did raise a similar question a few years ago: How do I sort tables?