开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜