ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Check whether specified Date is between two Dates in SQL Server<p>Hi <a class="username" rel="satabeach">satabeach</a>,</p> <p>Refer below sample query.</p> <p><span style="text-decoration: underline;"><strong>SQL</strong></span></p> <pre class="brush: sql">DECLARE @TestDateRange AS TABLE(StarDate DATETIME,EndDate DATETIME) INSERT INTO @TestDateRange VALUES(&#39;1-Jan-2019&#39;,&#39;10-Jan-2019&#39;) INSERT INTO @TestDateRange VALUES(&#39;15-Mar-2019&#39;,&#39;20-Mar-2019&#39;) INSERT INTO @TestDateRange VALUES(&#39;10-Apr-2019&#39;,&#39;25-Apr-2019&#39;) INSERT INTO @TestDateRange VALUES(&#39;3-May-2019&#39;,&#39;2-Jun-2019&#39;) DECLARE @Date DATETIME SET @Date = &#39;16-May-2019&#39; --SELECT * FROM @TestDateRange WHERE @Date BETWEEN StarDate AND EndDate IF EXISTS(SELECT * FROM @TestDateRange WHERE @Date BETWEEN StarDate AND EndDate) BEGIN SELECT &#39;YES&#39; END ELSE BEGIN SELECT &#39;NO&#39; END</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/193921/Check-whether-specified-Date-is-between-two-Dates-in-SQL-Server/https://www.aspforums.net:443/Threads/193921/Check-whether-specified-Date-is-between-two-Dates-in-SQL-Server/Mon, 20 May 2019 04:20:56 GMT