0

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 criteria?
I'm assuming some kind of projection should be applied.

I am using NHibernate 2 and Castle.ActiveRecord.

the_drow
  • 18,571
  • 25
  • 126
  • 193

1 Answers1

1

If you have moved to NH3, then with QueryOver you can simply compare them:

session.QueryOver<Trip>().Where(c => c.ArrivalDate >= c.DepartureDate).List();
Ilya Kogan
  • 21,995
  • 15
  • 85
  • 141