databarracks
asked on
MSSQL syntax to get all text left of first non-alphanumeric character
Hi Guys,
Does anyone know the syntax in MSSQL to get all the characters left from the first non-alphanumeric character:
What I have so far is below:
The LABEL value is 'Joe Bloggs [Duplicate - do not use]'
This yields 'Joe Bloggs ' which is ok but the issue is that someone could put any other character therefore it wouldn't work if someone puts ^ or / etc.
Could someone please kindly help me withthis?
Does anyone know the syntax in MSSQL to get all the characters left from the first non-alphanumeric character:
What I have so far is below:
The LABEL value is 'Joe Bloggs [Duplicate - do not use]'
SUBSTRING([LABEL],0,CHARINDEX('[',[LABEL],0))
This yields 'Joe Bloggs ' which is ok but the issue is that someone could put any other character therefore it wouldn't work if someone puts ^ or / etc.
Could someone please kindly help me withthis?
ASKER
But only issues is I do want to permit spaces?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Figured it out myself. Thanks anyway
ASKER
Open in new window