Variable Expression

  • When i used the below Expression in SSIS package variable.

    DATEADD("D",-(DAY(DATEADD("M",1,GETDATE()))),DATEADD("M",1,GETDATE()))

    result is

    12/31/2013 4:23:13 PM

    i am looking for a result in below format.

    2013-12-31 00:00:00.000

    Any help...

  • This'll do it:

    (DT_DBTIMESTAMP) (DT_DBDATE) DATEADD("D",-(DAY(DATEADD("M",1,GETDATE()))),DATEADD("M",1,GETDATE()))

    To clarify, I'm converting the DATETIME into DATE to strip the time and then re-converting back to DATETIME.

    🙂


    I'm on LinkedIn

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply