-
1. Re: Query problem
dsnyckers Sep 18, 2002 10:27 AM (in response to dsnyckers)I got it working but have another problem. I mentioned that I was querying the date in the ArrivalDate table.
But is it possible to query only on the year of the date.
So I only want the ArrivalDate ejbs where the date is of the specified year.
Query looks now like :
with %1 the id of the section (int)
and %2 the year (int)
SELECT OBJECT(a)
FROM Section s, IN(s.arrivalDates) a
WHERE s.id = %1 AND
year(a.date) = %2
but this last line doesn't work. Is there something to solve this problem,
TIA (again :)
Dave -
2. Re: Query problem
l.g. Sep 18, 2002 4:39 PM (in response to dsnyckers)try:
SELECT OBJECT(a)
FROM Section s, IN(s.arrivalDates) a
WHERE s.id = ?1 AND
year(a.date) = ?2 -
3. Re: Query problem
dsnyckers Sep 19, 2002 2:50 AM (in response to dsnyckers)Sorry,
it was a typo of me.
i was trying it with ?1 and ?2, but that doesn't work.
the year(a.date) causes the troubles
I think, I need to replace my date column with a Year, Month, Day and Time column, so that I can query on that.
Is this the only solution? -
4. Re: Query problem
l.g. Sep 19, 2002 10:40 AM (in response to dsnyckers)What datatype are you using as parameter for <a.date>?
I think you can use only long (milliseconds). And you cant usr <year()> function. See the specs.