You need:
if startday<stopday then
if the day is in the interval (startday,stopday) then OK
else NotOk
else
if the day is not in the interval (startday,stopday) then OK
else NotOk
It could be much easier done as:
If((day-startday)*(stopday-day)*(stopday-startday)>=0) then OK
else NotOk