• If I were to write the query (which was )

    SELECT *

    FROM #DateTest

    WHERE SampleDate BETWEEN @DATE1 AND @DATE2

    I would have written it

    SELECT *

    FROM #DateTest

    WHERE SampleDate >= @DATE1

    AND SampleDate < (@DATE2 + 1)

    That way I don't get into strife when my data contains a time that is greater than 23:59 and less than the start of the next day. Obviously I would have to remember to sanitise my inputs to ensure that the @date2 value coming in was a whole date (had no time fraction). Sorry I wasn't clearer earlier.

    EDIT! EDIT! EDIT! I would have written it this way assuming of course that I wanted to return all the activity on @DATE2.

    ...One of the symptoms of an approaching nervous breakdown is the belief that ones work is terribly important.... Bertrand Russell