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

Split data in a field 2

Status
Not open for further replies.

Hunguyen

IS-IT--Management
Nov 20, 2007
9
CA
I have a field where I would like to split the string into two fields. The string contains no spaces. The first (L-R)six characters is the postal code and the seventh character is a code#. I would like to split the postal code from the code#.

Ex.

FIELD1
V0N1Y67
V0N1Y69
V0N2X46
V0N1Y62

Desired result:

FIELD1 FIELD2
V0N1Y6 7
V0N1Y6 9
V0N2X4 6
V0N1Y6 2

This seems like it would be a common problem, but I have not been able to find a solution for it.
 
Something like:
Code:
Select Left(Field1,6) as NewField1, Right(Field1,1) as Field2
From YourTable
Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top