How to select 1st 20 characters of a field using T-SQL

1 view
Skip to first unread message

D

unread,
Dec 5, 2006, 11:01:56 AM12/5/06
to SQL Server
I tried using the LEFT function against one of our servers to retrieve
the 1st 20 characters of a column per record. Can someone tell me how I
can accomplish extracting only the 1st 20 characters of a field per
record? The field contains about 300+ characters, but I only need the
1st 20. Thanks!

Fábio Pinheiro

unread,
Dec 5, 2006, 11:18:09 AM12/5/06
to SQL-S...@googlegroups.com
select substring(field1,1,20) from table

D escreveu:

D

unread,
Dec 5, 2006, 12:16:37 PM12/5/06
to SQL Server
Thank you...this worked perfect :)

Reply all
Reply to author
Forward
0 new messages