Connection Manager Properties

  • Hi,

    I need some assistance in adapting this connection string expression to retrieve the previous day rather than the current day- GETDATE -1

    @[Dest_Dir] + "\\" + (DT_WSTR,2)DatePart("DD", GetDate()) + RIGHT("0" + (DT_WSTR,2)DatePart("mm", GetDate()), 2) + RIGHT("0" + (DT_WSTR,4)DatePart("YYYY", GetDate()), 2) + "FX.csv"

    Thanks in advance

  • You should be able to use GETDATE()-1 of you are not worried about the time of day. If that does not work look at ...

    in SQL - select CONVERT(DATETIME, DATEDIFF(dd, 0, DATEADD(dd, -1, GETDATE())))

    so for your use maybe just DATEADD(dd, -1, GETDATE())

    SQL DBA
    Every day is a school day, and don't trust anyone who tells you any different.
    http://sqlblogness.blogspot.co.uk

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

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