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
 SQL Server Development (2000)
 Query trim

Author  Topic 

lane0618
Posting Yak Master

134 Posts

Posted - 2002-05-15 : 14:47:18
I want the results of the query below to give me only the first 5 characters in the item field. Hoe can I do this?

SELECT ITEM
FROM DTLHG.dbo.ANA

Thanks,
Lane

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-05-15 : 14:53:58
SELECT Left(Item, 5) FROM DTLHG.dbo.ANA

or

SELECT Substring(Item, 1, 5) FROM DTLHG.dbo.ANA

Go to Top of Page

lane0618
Posting Yak Master

134 Posts

Posted - 2002-05-15 : 14:57:09
Thanks!

Go to Top of Page
   

- Advertisement -