From: Francois D. <fra...@de...> - 2009-01-15 14:40:42
|
Exactly! The 'day' attribute of Packet is a reference, testing with == tests the equality of reference, not the equality of referenced object. You must use is_equal for that. A possible query is: select t from Test t where t.d.is_equal(date::date(2009,1,15)) == 1; François Le vendredi 09 janvier 2009 à 12:51 -0500, Michael George Hart a écrit : > It is clear you can't do a == directly on the date however you can > do the following > select p from Packet p where p->day.is_equal(date::date(2009,1,9)) == 1 > > Michael > > On Friday 09 January 2009 12:30:34 pm Michael George Hart wrote: > > Here I have a query > > > > ? select p from Packet p where p.mid == 0x9000112; > > = bag(3013.2.660104:oid) > > ? \p > > Packet {3013.2.660104:oid} = { > > *day = {3011.2.681311:oid}; > > mid = 150995218; > > market = "nasdaq"; > > records set<Record*> = set { > > name = ""; > > count = 98555; > > }; > > }; > > > > As you can clearly see > > ? 3013.2.660104:oid.day.year(); > > = 2009 > > ? 3013.2.660104:oid.day.month(); > > = 1 > > ? 3013.2.660104:oid.day.day(); > > = 9 > > Has the date 2009-01-09 > > > > Also note that > > ? date::date(2009,1,9).year(); > > = 2009 > > ? date::date(2009,1,9).month(); > > = 1 > > ? date::date(2009,1,9).day(); > > = 9 > > Produces the same date > > > > So what does the following query fails to produce a result? > > > > ? select p from Packet p where p->day == date::date(2009,1,9); > > = bag() > > ? > > > > Michael > > > |