using unstr and substr and upper

I have an object…

  1. convert to upper case (which I have done)
    upper(EMPLOYEEID)

  2. The ID’s are displayed like this: nt domain\joe bloggs

What I want to do is chop on the gighlighted bit. But the thing is the number of characters to be chopped will vary as the domains could differ so really what I want to say is 'chop off everything after the “/”.

any idea how to do this using instr and substr?


prishma123 (BOB member since 2010-02-22)

Hi,

Try below syntax …

substr(EMPLOYEEID,1,(instr(EMPLOYEEID,’’)-1))


pravin_gaikwad :india: (BOB member since 2010-03-27)

hi, the sytax works but it returns the first few char before the /. for example, it return domain but I want tit to return everything after the slash. Full field is domain\user id so I want to retun only the user id


prishma123 (BOB member since 2010-02-22)

hi ,
I hope follwing syntax will work as per ur requirement

substr(EMPLOYEEID,(instr(EMPLOYEEID,’’)+1))


pravin_gaikwad :india: (BOB member since 2010-03-27)

thanks it works a treat


prishma123 (BOB member since 2010-02-22)