I have to dates in my query: ExpectedEnd and TerminationDate.
I need to find a query that returns records whenever the ExpectedEnd is at the same day as TerminationDate. How can it be done using detached cri开发者_运维知识库teria? I'm assuming some kind of projection should be applied.I am using NHibernate 2 and Castle.ActiveRecord.
If you have moved to NH3, then with QueryOver you can simply compare them:
session.QueryOver<Trip>().Where(c => c.ArrivalDate >= c.DepartureDate).List();
精彩评论