• As Ray indicated earlier, (DT_DBDATE)0 evaluates to 1899-12-30. This would be equivalent to using -2 inplace of 0 in the T-SQL calls as shown here:

    /*

    Date Available in db Result Expected Result

    01/11/2012 01:28 03/11/2012 00:00 29/10/2012 00:00

    04/11/2012 19:12 10/11/2012 00:00 03/11/2012 00:00

    06/11/2012 09:34 10/11/2012 00:00 03/11/2012 00:00

    12/11/2012 10:59 17/11/2012 00:00 10/11/2012 00:00

    */

    WITH TestData AS (

    SELECT

    cast(TestDate as datetime) TestDate

    FROM

    (VALUES ('20121101 01:28'),('20121104 19:12'),('20121106 09:34'),('20121112 10:59'))dt(TestDate)

    )

    select

    TestDate,

    dateadd(wk,datediff(wk,0,TestDate),0),

    dateadd(wk,datediff(wk,-2,TestDate),-2)

    from

    TestData;