February 10, 2009 at 9:40 am
I need to return the user name values on a field, but the names are prefixed with the domain name, for example, one value may read DOMAIN\jdoe; other may read DOMAINgbaker.
I only need to return the actual usernames, but I'm having issues accomplishing this.
thx,
John
February 10, 2009 at 9:45 am
Do you have any delimeter to differentiate these??
Thanks
Vijaya Kadiyala
February 10, 2009 at 9:47 am
If by delimeter you mean backslash "\" after the name of the domain, then that's it. Otherwise, I'm lost.
John
February 10, 2009 at 9:55 am
Try this:
SELECT SUBSTRING(ColumnName, CHARINDEX('\', ColumnName) + 1, 100)
FROM TableName
Greg
February 10, 2009 at 10:04 am
Perfect. thx,
John
February 10, 2009 at 10:30 am
Simple solution 🙂
Thanks
Vijaya Kadiyala
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply