Hi, I have an Oracle database table with 2 DATE columns (start_date and
end_date). I want to use Criteria to do the following SQL:
select * from table_name where start_date <= sysdate AND end_date >=
sysdate
I have the following code:
int year = Calendar.get(Calendar.YEAR) - 1900;
int month = Calendar.get(Calendar.MONTH);
int date = Calendat.get(Calendat.DAY_OF_MONTH);
Criteria c = new Criteria();
c.andDate(TableNamePeer.START_DATE, year, month, date,
Criteria.LESS_EQUAL);
c.andDate(TableNamePeer.END_DATE, year, month, date,
Criteria.GREATER_EQUAL);
The Criteria's andDate method only takes year, month and date, not hour,
min. and seconds, so I can't compare hour, min. or sec.
Howard Lin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]