SQLTeam.com | Weblogs | Forums

Two questions, not seen an answer to either


#1
  1. when doing replace multiple times, is it out side in or inside out
    (replace(replace(replace(replace([FULL NAME],'-DO NOT BOOK',''),'(a3)',''),'a3',''),'k3','')

i.e k3 or DO NOT BOOK that are dealt with first

  1. I have four temp tables

select distinct
EMPLOYEE_ID
,''as [FULLNAME2]
,gender
,DoB
,JoinDate
,status as picker
FROM #latest
union all
select distinct
EMPLOYEE_ID
,'' as [FULLNAME2]
,gender
,DoB
,JoinDate
,status as picker
from #oldest0

I want to wrap the four tables into a single additional temp table, everything I have tried warns of an error, at either end of the data usually highlighlighting ) or similar, then I can improve the find and replace on the NAME query so I don't have to process 4 times. What is the structure of the wrap on the example of two above so the temp table will be #finaltable, overall its at 60,000 rows and bringing some of these together will reduce to overall numbers


#2

seems I found an answer to the first part, that it works from inner to outer (and is case insensitive to boot)


#3

HI

PLEASE TRY THIS

HOPE IT HELPS
THANKS
:slight_smile:
:slight_smile:

TEXT

REPLACE(REPLACE(REPLACE(REPLACE([FULL NAME],'-DO NOT BOOK',''),'k3','')'(a3)',''),'a3','')