SSIS Expressions Question - Syntax help

  • Take a look at the attached pic 

    @[$Project::OutPutFilePath] +  @[$Project::DiagFile_MEDICAID]

    The value in the variable  @[$Project::DiagFile_MEDICAID] = "MEDICIAD_YYYYMMDD_HHMM.txt"

    What I need from you is a syntax expression that will replace the   YYYYMMDD_MMHH with the  current date and time in the format specified.

  • mw_sql_developer - Friday, February 8, 2019 3:08 PM

    Take a look at the attached pic 

    @[$Project::OutPutFilePath] +  @[$Project::DiagFile_MEDICAID]

    The value in the variable  @[$Project::DiagFile_MEDICAID] = "MEDICIAD_YYYYMMDD_HHMM.txt"

    What I need from you is a syntax expression that will replace the   YYYYMMDD_MMHH with the  current date and time in the format specified.

    ahh that should be DiagFile_MEDICAID

  • Is the "YYYYMMDD_MMHH" part hard coded?

    For better, quicker answers, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Mike01 - Friday, February 8, 2019 3:16 PM

    Is the "YYYYMMDD_MMHH" part hard coded?

    YES it is .. You just have to do a replace

  • mw_sql_developer - Friday, February 8, 2019 3:24 PM

    Mike01 - Friday, February 8, 2019 3:16 PM

    Is the "YYYYMMDD_MMHH" part hard coded?

    YES it is .. You just have to do a replace

    Or just show me how to make a string variable in the   YYYYMMDD_HHMM  format ( and I can do the rest )

  • mw_sql_developer - Friday, February 8, 2019 3:28 PM

    mw_sql_developer - Friday, February 8, 2019 3:24 PM

    Mike01 - Friday, February 8, 2019 3:16 PM

    Is the "YYYYMMDD_MMHH" part hard coded?

    YES it is .. You just have to do a replace

    Or just show me how to make a string variable in the   YYYYMMDD_HHMM  format ( and I can do the rest )

    Got some done...

    (DT_WSTR,4) YEAR(GETDATE()) +
    RIGHT("0" + (DT_WSTR,2) MONTH(GETDATE()),2) +
    RIGHT("0" + (DT_WSTR,2) DAY(GETDATE()),2) +
    "_" +

    Help me get the hour and minute

  • You can try something like this

    (DT_STR,4,1252) datepart("yyyy", getdate()) + Right("0" + (DT_STR,2,1252) datepart("mm", getdate()),2) + Right("0" + (DT_STR,2,1252) datepart("dd", getdate()),2) + "_" + Right("0" + (DT_STR,2,1252) DatePart("hh",getdate()),2) + Right("0" + (DT_STR,2,1252) DatePart("mi",getdate()),2) + Right("0" + (DT_STR,4,1252) DatePart("ss",getdate()),2) + Right("000" + (DT_STR,3,1252) datepart("Ms", getdate()),3)

    For better, quicker answers, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Viewing 7 posts - 1 through 6 (of 6 total)

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