Hello,
I have a problem that I know someone else has solved before, but I just can't find the solution myself.
We're using Oracle 9i and named queries in Hibernate 2.1.7. One of the database column's type is a datetime, but we'd like to be able to force the where clause to use a TO_DATE style formatting mechanism to compare based on MM/DD/YYYY.
The query snippet is as follows:
Code:
select payrollWeek
from PayrollWeek pw
where pw.record_date = :recDate
I can trim :recDate in my code, but pw.record_date in some cases will have timestamp information, and in others it won't, so I'd like to discard that the way you would in Oracle:
Code:
select columns
from PayrollWeek
where to_date(record_date, 'MM/DD/YYYY') = :recDate
I apologize if this is a trivial problem, but I did search the documentation and have come up empty-handed.
Thanks for any and all responses,
John