how to remove underscore in between date and time stamp

  • i have an expression

     

    @[User::SharePath]  +"\\"+ Replace(Replace(Replace(Replace( @[User::FileName],".","_"+Substring((DT_WSTR,50) GETDATE(),1,19)+"."),"-",""),":","")," ","_")

    the file will be generated as below DetailRecords_20191127_113247.xlsx

    i want to remove underscore in between date and timestamp. final output should be DetailRecords_20191127113247.xlsx

  • Looks easy enough. Did you try?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • If you don't want underscores in your final value, why are you replacing " " with "_"? That's like saying you don't want a blue car, you want a red car, and when offered the choice of a blue or red car, you choose the blue car.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • tried, giving invalid token errors

  • Change the end of the statement from ," ","_") to:

    ," ","")

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

  • ty, it worked

  • You're welcome.  Thanks for the confirmation!

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

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

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