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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse partial string 1

Status
Not open for further replies.

Palmyra

Programmer
Jan 5, 2007
150
US
I think this is a dumb question, but I'm stuck.

I need to select part of the value in a field. I need to start at position 1 and only select to position 50.

My attempt, which is wrong:

SELECT left(fieldname,1,50) as newfield FROM table


Thanks.
 
Code:
SELECT LEFT(fieldname,50)
FROM Table

or

Code:
SELECT SUBSTRING(fieldname,1,50)
FROM Table


Borislav Borissov
VFP9 SP2, SQL Server 2000,2005 & 2008.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top