Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am using the logic below to strip out the domain from a username e.g. user1\username -> username. It works fine for the majority of users, but a few have a longer domain, but it only removes the same length as the shorter one rather than being reactive to the different length.
e.g.
lower(right([Authenticated user],findoneof([Authenticated user],'\')+1) ) as [Authenticated user stripped],
user1\username -> username
longuser1\username -> ser1\username
I am using 10SR6 for this project - I cannot see this as a known issue but maybe I have missed something, or is this expected functionality.
Thanks
Paul
It's not a bug. With your logic, if you use Mid() instead of right(), it works. Try:
lower(Mid([Authenticated user],findoneof([Authenticated user],'\')+1) ) as [Authenticated user stripped],
WHy don't you try subfield([Authenticated user], '\') ?
Try with subfield() like:
SubField([Authenticated user] , '\' ,2) as [Authenticated user stripped]
right([Authenticated user],Len(Authenticated user) - index([Authenticated user],'\')) as [Authenticated user stripped]
subfield is a better solution
Thanks for all the replies. I have changed it to substring, I assume that is the correct result if using findoneof? Just seemed like a bug to me!
no bug, you did not write it correctly. You need to take the string length minus the findoneof...
It's not a bug. With your logic, if you use Mid() instead of right(), it works. Try:
lower(Mid([Authenticated user],findoneof([Authenticated user],'\')+1) ) as [Authenticated user stripped],