creating a new field from part of another

  • Thread starter Thread starter Jerry Crosby
  • Start date Start date
J

Jerry Crosby

I have a field with City, State and Zip all together (didn't create it that
way, I inherited it!). I want to create a new field in the table with just
the zip code, so I can sort it by zip for mailing purposes.

I assume it would be a "create a new table" query, but how do I code it?

Thanks in advance.

Jerry
 
You can actually use an update query. Just create a new field in the same
table for the zip code value (name it ZipCode).

Assuming that the zip code consists of all characters in the field after the
last space character:

UPDATE TableName
SET ZipCode = Mid([CityStateZipField], InStrRev([CityStateZipField], " ") +
1);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top