Q: SQL - Time Range (CASE WHEN) I am working on a Time Query with the following logic. But I am not familiar with time query. Can anyone help? 
CASE WHEN (07:00:00) TO (07:10:00) is between [STARTTIME] AND [STOPTIME] THEN 'YES'

Start Time and Stop Time are both DateTime Field

A: Why not 
CASE WHEN '07:00:00' >= [STARTTIME] AND '07:10:00' <= [STOPTIME] THEN 'YES'

if I understand clearly what you want to do.

A: HERE is the query :-  I used @start_Time(for STARTIME) and @end_Time (for STOPTIME) as local variable you can replace them. (As you said between i am taking in between those values if you need to include those time too then instead of > you need to put >= and same with < replace with <=). 
 select CASE WHEN ((time_to_sec(timediff('07:00:00', time(@Start_Time))))>0 
           AND  (time_to_sec(timediff('07:00:00', time(@end_Time))))<0) 
    AND
        ((time_to_sec(timediff('07:10:00', time(@Start_Time))))>0 
           AND  (time_to_sec(timediff('07:10:00', time(@end_Time))))<0) =1 
           THEN 'YES' else 'NO' END

Hope it helps you !!
