I have a query with the parameters: @SId, @StartDate, @EndDate
I have a table MyTable with the columns Id, UserId,SId, StartDate(datetime), EndDate(datetime)
I would like to return all UserId where SId=@SId
and where the user is not occupied between StartDate and EndDate.
How would be best to do that?