Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning just partial part of field
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01353360
Message ID:
01353371
Views:
14
DECLARE @str varchar(50)
SET @str = 'SFM-ADM-01MAIN # KIRK.KELLY'
SELECT LEFT(@str, CHARINDEX(' #', @str)-1) 
>We have a field in the database populated with the Workstation # UserID. In SQL Server, I need to pull back just the workstation part of the field. In VFP I would use the at() function to get the starting location of the #, but I'm not sure how to do that in SQL Server.
>
>
>Sample Field value: SFM-ADM-01MAIN # KIRK.KELLY
>
>Thanks
>
>Kirk
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform