If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Splitting up zipcode

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-28-03, 04:53
EvE EvE is offline
Registered User
 
Join Date: Aug 2002
Location: Holland
Posts: 16
Splitting up zipcode

I have an access db with a column zipcode I want to split up:

3022 EB

Now I would like to create 2 separate colums. 1 will have the first 4 digits and the 2nd column will get the last 2 letters.

It is always 4 digits and 2 letters with.

How can I split them?
Reply With Quote
  #2 (permalink)  
Old 10-28-03, 08:18
vextout vextout is offline
Registered User
 
Join Date: Jan 2003
Location: New York
Posts: 160
use the split function - which will create an array

when you wrote
3022 EB -- is there a space or did you display that for easy reading
==========================
if there is a space then do the following

NewZip = split(zipcode)
By doing this it splits zipcode by space,
NewZip(0) will equal 3022
and
NewZip(1) will equal EB

==========================
else if there is no space and you know you want first four chars then
NewZip4 = left(zipcode,4)
NewZip2 = right(zipcode,2)
==========================
__________________
Beyond Limitation
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On