开发者

How to compare only the MM/dd/yyyy part of two dates with a detached criteria?

开发者 https://www.devze.com 2023-02-23 00:11 出处:网络
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.

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();
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号