AND ScheduledStatus.EndDateTime <= eTime) OR (eTime >=
IFNULL(ScheduledStatus.StartDateTime,sTime) AND eTime <=
ScheduledStatus.EndDateTime)