比较 LINQ to SQL 中的两个日期
我有一个数据库,其中有一个名为会议的表。会议日期使用以下格式存储在此表中:2011 年 5 月 2 日
的格式(例如)为 5/2/2011
。
我的要求是获取两个日期之间的会议(例如,2011 年 4 月 25 日和 2011 年 5 月 2 日),并编写一个查询来比较日期与这两个日期。是否与 2011 年 4 月 25 日相比 < 2011 年 4 月 26 日?比较是如何进行的?
我正在使用 SQL Server 2008 和 LINQ to SQL 查询。
I have a database with a table named meeting. Meeting dates are stored in this table using the following format: May 2nd 2011
is (for example) formatted as 5/2/2011
.
My requirement is to get the meetings between two dates (say, 4/25/2011 and 5/2/2011) and to write a query comparing a date with these two dates. Does it compare like 4/25/2011 < 4/26/2011? How does the comparison take place?
I am using SQL Server 2008 and LINQ to SQL queries.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
像这样的东西
Something like this
查询风格:
方法风格:
Query style:
Method style: