Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Reportquery, days between sysdate and date column with ordering

16414Mar 15 2007 — edited Mar 16 2007
Hi,

I want to have a query like this:
select trunc(sysdate - mydatecolumn) days
from   table
order by days
I have something like this:
query.addAttribute("days", ExpressionMath.subtract(expBuilder.currentDate(), expBuilder.get("mydatecolumn"));
query.addOrdering(?);
How to add the trunc and how to add the ordering without specifying the expression again?

I am using Toplink 10.1.3 on a 10.2 Oracle database.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 13 2007
Added on Mar 15 2007
2 comments
959 views