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)
 Searching first 36 characters of a text field

Author  Topic 

MBeal
Posting Yak Master

110 Posts

Posted - 2003-01-23 : 14:10:50
I tried this query but because of the data type of TEXT, it wouldn't work properly.

Select AccountNo, AcctMgr, Left(Notes,36) [Notes]
from Contact
Where AcctMgr = 'Megan Wright' and
Notes is not null

I simply want to return the first 36 characters of this field. Is this possible?

MBeal

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-01-23 : 14:13:54
How about:

Select AccountNo, AcctMgr, Convert(varchar(36), Notes) [Notes]
from Contact
Where AcctMgr = 'Megan Wright' and Notes is not null


Go to Top of Page

MBeal
Posting Yak Master

110 Posts

Posted - 2003-01-23 : 14:17:06
Once again -- quick replies from the SQLTeam allows me to keep working! Thanks again!

MBeal
Go to Top of Page
   

- Advertisement -