-
1. Re: Compare Dates in Finder Method
julien.dubois Feb 16, 2004 11:48 AM (in response to neelsaeed)Create 2 dates :
Date today;
Date tomorrow;
And initialize "today" with today's date at midnight, and "tomorrow" with tomorrow's date at midnight.
Then you can do :
(...) AND sch.departureTime >?2 AND AND sch.departureTime <?3
That way you will get all of today's schedules.
HTH, -
2. Re: Compare Dates in Finder Method
vvijith Feb 17, 2004 4:19 AM (in response to neelsaeed)Probably this may work out for you... with some amout of extra coding.
The EJB QL for the finder would be
SELECT OBJECT(o) from myBean as o where SUBSTRING(o.startdate,0,9) = ?1
startdate is a date field in the database and the finder method will take string as the parameter.
This string parameter should be the date that you want to check from the database. The default format for the date field from the database also matters in this approach.
So the finder definition would be
Collection findCustomersOnDate(java.lang.String date)
//date ="16-FEB-04"
The finder will return a collection and when you print the date field, you can always get the full date(ie untruncated)
cheers....