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?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • 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) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • ty, it worked

  • You're welcome.  Thanks for the confirmation!

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

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

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