Hi satabeach,
Use the BETWEEN clause in the WHERE condition.
Refer below sample query.
SQL
DECLARE @TestDateRange AS TABLE(StarDate DATETIME,EndDate DATETIME)
INSERT INTO @TestDateRange VALUES('1-Jan-2019','10-Jan-2019')
INSERT INTO @TestDateRange VALUES('15-Mar-2019','20-Mar-2019')
INSERT INTO @TestDateRange VALUES('10-Apr-2019','25-Apr-2019')
INSERT INTO @TestDateRange VALUES('3-May-2019','2-Jun-2019')
DECLARE @Date DATETIME
SET @Date = '16-May-2019'
--SELECT * FROM @TestDateRange WHERE @Date BETWEEN StarDate AND EndDate
IF EXISTS(SELECT * FROM @TestDateRange WHERE @Date BETWEEN StarDate AND EndDate)
BEGIN
SELECT 'YES' 'IsExist'
END
ELSE
BEGIN
SELECT 'NO' 'IsExist'
END
Output
IsExist
YES