thanks I will look at cross apply
in order to get something to Mexico, I just did this
I know it is just brute force coding, but I had to get something to the end user this morning. I will research your answer and clean up my code next week. thanks
Select
account,
substring([ACCOUNT],1,2)+ '-'+substring([ACCOUNT],7,4)+'-'+substring([ACCOUNT],3,4)+'-'+substring([ACCOUNT],11,4)AS Segment1,
substring([account],1,2) AS segment2,
substring([account],7,4) AS segment3,
substring([account],3,4) AS segment4,
substring([account],11,4) AS segment5,