• You really don't want to be building your searches this way. What happens when you change from a datetime data type to a datetime2 data type?

    You will then be forced to update your code because now it could be missing data again.

    A better way to do your checks is to use this:

    WHERE datecolumn >= {start date and time = 00:00:00.000}

    AND datecolumn < {end date + 1 and time = 00:00:00.000}

    For example:

    WHERE datecolumn >= '2013-01-01 00:00:00.000' -- from the first of the year

    AND datecolumn < '2013-03-01 00:00:00.000' -- less than March 1st

    The above will include everything for January and February - but not include March.

    Using BETWEEN or <= requires you to add the time, and as I stated before will require that you update your code if the data type changes.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs