I reckon you have tried the obvious way, but in the case you did not try it
here is the suggestion:

addAscendingOrderByColumn(SomePeer.STOPTIME + " - " + SomePeer.STARTTIME);

or, if this fails, maybe

addAscendingOrderByColumn("(" +SomePeer.STOPTIME + " - " +
SomePeer.STARTTIME+ ")");

works.

I did not try if this works with Torque 3.2. I am quite sure it will not
work with pre-3.2 Torque.

       Thomas

John Dunne <[EMAIL PROTECTED]> schrieb am 31.03.2006 18:13:55:

> Evening all,
>
> I have a table with two columns; one that stores the start time of a
> session and another with the stoptime of a session, cryptically named,
> STARTTIME and STOPTIME.
>
> Sorting by one or the other is easliy done by addDescendingOrderByColumn
> (or, of course, addAscendingOrderByColumn). But how can I sort by the
> difference between these two columns (i.e. the session duration)? This
> can be done in sql by simply stating ORDER BY STOPTIME - STARTTIME, but
> can I do this using the criteria object?
>
> Thanks in advance,
> John.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to