如果日期之间的当前月份,如何选择行。 [英] How to select rows if the date between is in current month.
问题描述
嗨朋友
我有一个表有两个字段FromDate和ToDate,还有很多数据。
什么我想要的是获取行如果当前月份在这些日期和时间之间。
例如:
(1)FromDate = 20 / Dec / 2013& ToDate = 2014年2月15日,因此如果选择了当月(2014年1月),则会出现。
(2)如果FromDate = 05 / Jan / 2014& ToDate = 10 / Jan / 2014,如果选择当前月份也会出现?
有人能给我一个返回这样结果的查询吗?
谢谢
Hi friends
I have a table that has two fields FromDate, and ToDate, and lots of data in it.
What I want is to get the rows If current month is midst of these fromdate and todate.
Eg:
(1) FromDate = 20/Dec/2013 & ToDate = 15/Feb/2014, So It should appear if Current Month (Jan 2014) is selected.
(2) If FromDate = 05/Jan/2014 & ToDate = 10/Jan/2014, This also should appear if current month is selected?
Can anybody give me a query that returns result like this ?
Thanks
推荐答案
嗨朋友们,
我发现它最后。,。,这很简单...感谢所有回复我的朋友...
Hi friends,
I found it last.,., It was so simple... Thanks all friends who replied me ...
SELECT * FROM RM_UserBookingData WHERE (FromDate< MAX_DATE_OF_THIS_MONTH) AND (ToDate> MIN_DATE_OF_THIS_MONTH)
这篇关于如果日期之间的当前月份,如何选择行。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!