Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 taking some of the data from the field

Author  Topic 

kris22
Starting Member

35 Posts

Posted - 2009-09-02 : 19:46:44
Hi,
i have a field in one of the table with Active support C/O Los Angeles
when i do the query i want to eliminate C/O Los Angeles. I just want to take Active Support. can you guys help me with this?
Thx

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-09-03 : 01:55:42
declare @t varchar(64)

select @t = 'Active support C/O Los Angeles'

select left(@t,charindex(' ',@t,charindex(' ',@t,1)+1))
Go to Top of Page

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-09-03 : 02:42:09
Hi also try this

declare @t varchar(64)

select @t = 'Active support C/O Los Angeles'

select substring(@t,1,charindex('C/O',@t)-1)
Go to Top of Page
   

- Advertisement -