I want to compare a column value to the current date, using HQL.
I tried
IQuery someQuery = session.CreateQuery(String.Format(
@"Select s.Id
From InventoryProductStateItem s
where s.ValidFrom < current_date()"));
This throws the exception “Incorrect syntax near keyword current_date()”
current_date does´nt work either.
It’s been a while since I used NHibernate, but I think there’s a hql function called “current_timestamp” that the various dialect implementations in NHibernate map to their own sql dialect variant.
Failing that, you could always turn it into a parameter.