Compare datetime property to certain date via HQL (.Net) -
I have a problem comparing the data time property of objects and when trying to compare it to a given date For example, I tried
IQuery query1 = session.Creatate (String.Format (@ "select s.Id s from the inventoryProductStateItem where s.ValidFrom =" + stateItem.ValidFrom));
But get an exception "incorrect syntax".
Dates can be compared by passing a parameter to the query:
< Code> IQuery query1 = session.CreateQuery (String.Format (@ "select s.Id from Inventory ProductState Item ss. ValidFrom =: stateDate)")). Setpalmator ("Statedate", State Legal Form);
Comments
Post a Comment