I should convert to the fallowing SQL-Query to NHibernate HQL (NHibernate 3.2). But I don’t know, how I have to translate the FLOOR, DATEDIFF and GETDATE.
SELECT Birthday FROM Person
WHERE 1 = (FLOOR(DATEDIFF(dd,Birthday,GETDATE()+10) / 365.25))
-
(FLOOR(DATEDIFF(dd,Birthday,GETDATE()-5) / 365.25))
Untested, but would something like:
This do the same thing?
Taking a look at the source code, floor is already registered in the dialect, so the following:
Produces the following SQL: