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

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -