Link to home
Start Free TrialLog in
Avatar of Marcus Aurelius
Marcus AureliusFlag for United States of America

asked on

How to replace WHITESPACE (1 or more spaces) in a field with a SINGLE DASH?

My field has data like this:

1P0007.63579.0000                           1609168541          899972053           1230

I need to remove all spaces (1 or more) and replace the blank space with a single dash '-' like this:

1P0007.63579.0000-1609168541-899972053-1230

Can someone tell me what SQL Code to use?
ASKER CERTIFIED SOLUTION
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
A similar method could be used with the scripting function in SSRS if you are generating a report.
Avatar of Marcus Aurelius

ASKER

MANY, MANY THANKS!

Now please see my new question related to this...here:  
https://www.experts-exchange.com/questions/28967659/How-to-CONCANTENATE-ROWS-of-data-into-a-flat-single-ROW.html