Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

How to filter the record based on months between Start date and End Date

$
0
0

Hi,

Thanks for looking into this thread.

I have a below table

ID|StartDate  | EndDate   |Name |
1 |2016-09-01 | 2016-09-30|Name1|
2 |2016-07-01 | 2016-09-30|Name2|
3 |2016-07-01 | 2016-10-30|Name3|
4 |2016-06-01 | 2016-08-30|Name4|

I wanted to select the rows only for August(08) month. 

My result should be of 

ID|StartDate | EndDate  |Name |

2 |2016-07-01 | 2016-09-30|Name2|

3 |2016-07-01 | 2016-10-30|Name3|

4 |2016-06-01 | 2016-08-30|Name4|

Please suggest a query on How would i be able to filter based on the month filter between the two dates.


Regards, Vignesh S


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>