• var05 (12/3/2012)


    Hi All,

    I wanted to find the starting of the week and poulate it as an additional column. Im trying to use dervived column in SSIS

    SQL Equivalent is:

    SELECT DATEADD(WK, DATEDIFF(WK,0,'11/01/2012'), 0)

    2012-10-29 00:00:00.000 - Fine

    Im not able to use the same sql statement in SSIS dervived col. I tried using the below expression:

    DATEADD("WK",DATEDIFF("WK",(DT_DBDATE)0,'11/01/2012'),(DT_DBDATE)0).... --- But this returns diff results

    03/11/2012 00:00:00. ---It returns the subsequent saturday and not the staring day of the week i.e Monday. Any help on this?

    Thanks!

    Change this:

    DATEADD("WK",DATEDIFF("WK",(DT_DBDATE)0,'11/01/2012'),(DT_DBDATE)0)....

    To this:

    DATEADD("WK",DATEDIFF("WK",(DT_DBDATE)"1900-01-01",'11/01/2012'),(DT_DBDATE)"1900-01-01")....

    Let us know if this works.