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 2005 Forums
 Transact-SQL (2005)
 left function

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2008-04-07 : 05:21:52
i have a query

select message from ticket

but i want to only get the first 100 characters

select left(message,100) from ticket

is giving me an error - please advise?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-04-07 : 05:25:20
If Message is a TEXT column, you will have this error.
Try SUBSTRING(Message, 1, 100) instead.

And furthermore, please provide this additional information next time.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2008-04-07 : 05:58:23
yes that was the issue

thanks for your help
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-04-08 : 03:08:41
quote:
Originally posted by esthera

i have a query

select message from ticket

but i want to only get the first 100 characters

select left(message,100) from ticket

is giving me an error - please advise?


Why dont you give exact error message instead of letting us to guess it?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -