• Unless there is some performance issue that I haven't spotted, it should be sensible to do this the simple and obvious way:

    SELECT LoadNumber

    FROM LoadTimes

    WHERE (@Now >= StartTime AND (@Now < EndTime OR StartTime >= EndTime))

    OR

    (@Now <= EndTime AND EndTime < StartTime)

    I can't see that adding or subtracting 12 hour chunks buys you anything useful, the calculation is just as complex if you do that.

    Tom