Re: Concatenation help needed.
From: David Schleifer [MSFT] (dschleif_at_online.microsoft.com)
Date: 05/12/04
- Next message: Rohan Hattangdi: "Re: Help me convince the dev manager. Please."
- Previous message: Bob Lee: "Re: Validation query"
- In reply to: Ralph Sharett: "Concatenation help needed."
- Next in thread: Aaron Bertrand [MVP]: "Re: Concatenation help needed."
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 12 May 2004 15:42:22 -0700
You can try something like this:
select substring(CustomerID, 1, 2)+':'+substring(CustomerId, 3,
2)+':'+substring(CustomerId, 5, 1) as myfield from orders
Against the northwind sample database this would return
VI:NE:T
TO:MS:P
<etc>
- Dave
"Ralph Sharett" <rsharett@frch.com> wrote in message
news:%23Y7cKxGOEHA.892@TK2MSFTNGP09.phx.gbl...
> I am trying to pull data from an old database table to the new database.
In
> the old database the field in question is formatted to have text like
> this....10DS23.
>
> I need to same info but in the new database the field needs a colon: every
> two characters so the same field would in the new database would
> read....10:DS:23.
>
>
> Any ideas or help would be appreciated.
>
> Thanks,
>
> Ralph
>
>
- Next message: Rohan Hattangdi: "Re: Help me convince the dev manager. Please."
- Previous message: Bob Lee: "Re: Validation query"
- In reply to: Ralph Sharett: "Concatenation help needed."
- Next in thread: Aaron Bertrand [MVP]: "Re: Concatenation help needed."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|