nhibernate hql date functions
Posted
by Russel
on Stack Overflow
See other posts from Stack Overflow
or by Russel
Published on 2010-03-19T09:54:30Z
Indexed on
2010/03/21
6:21 UTC
Read the original article
Hit count: 413
nhibernate
|hql
Hi
Im writing a notification platform using C# and NHibernate. Im having difficulties with my queries.
I have a Customer entity - which contains a AssessmentCompleted Property. A notification should be sent out 21 months after certification. So my query needs to include all customers where their AssessmentCompletedDate + 21months < currentDate. How do I achieve this? Is there a month add method in nhibernate? I need to add 21 months to each AssessmentCompletedProperty...My query needs to look something like:
SELECT new Notification(c.Id, c.Description, c.AssessmentCompleted + 21
FROM Cusomter c
AND c.AssessmentCompleted + 21 <= :EndDate
© Stack Overflow or respective owner