How can I construct the Where clause of the ObjectQuery where I will be querying for the Time part only of a DateTime column? I've tried the following but it's not working. I get an invalid exception on Convert.
ObjectQuery<Item> _Query = ItemEntities.CreateQuery<Item>("Item");
_Query = _Query.Where("Convert(VARCHAR,it.START_TIME,114) > '{0}'", startTime.TimeOfDay);
Also, I'm using Oracle as database. So I tried to_char instead of convert and still I get the same error.
Thanks.
You should be able to get the time portion from the date using
TO_CHARand then subsequently converting it to a system type e.g.If
ObjectQuerydoesn't supportTO_CHARyou try usingExtractand build up the time manually e.g.