Home Forums SQL Server 2008 T-SQL (SS2K8) Pulling incorrect records using date range in where clause RE: Pulling incorrect records using date range in where clause

  • below86 (4/23/2014)


    Good to know, I wasn't aware that it rounded up.

    It is wierd that if you do .998 it shows as .997.

    declare @d datetime;

    set @d = '2014-04-23 23:59:59.998'

    select @d

    0

    This comes from the fact that datetime is accurate within 3.333ms. So .995 rounds up to .997, .992 rounds up to .993 , etc...

    Datetime in BOL

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?