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

Restrict query result to 4 characters 1

Status
Not open for further replies.

MA04

Technical User
Dec 21, 2004
162
GB
Hi all,

I was wondering how i may restrict a result to 4 characters. The query reads in a postcode and displays a code like so: 38UCFZ i want to display the first 4 characters so displaying: 38UC. Any help appreciated, thanks in advance,

M-.
 
Try this:

SELECT LEFT(postcode,4) as newpostcode from yourtable

-SecondToNone
 
Hi -SecondToNone

Thanks for the quick reply just what i was after,
M-.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top