Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Truncating VARCHAR text pulled down from query?

Status
Not open for further replies.

jasonsalas

IS-IT--Management
Jun 20, 2001
480
GU
What’s the name of the function in SQL Server that lets you truncate the amount of data that’s pulled down in a field? I’m querying a DB table and need to only return at most 15 characters of a large VARCHAR field.

Thanks!
 
Try left()

Code:
select left(fieldname,15) from tablename
 
Left, substring

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top