Delete Partial Values of a field

G

Guest

Hello,

I have a field on my table used to hold addresses. However, during the
upload, both address, city, state, and zip got uploaded into the same field.

Is there any way to delete everything but the address.

Example: 123 bird lane, houston, tx, 77478

They are seperated by commas, so i want to just keep the 123 bird lane, and
delete everything else. Problem is every address is different lengths, and i
do not know how to just keep the everything prior to the first comma
separator.

please help.

Thank you in advance.
 
J

John Spencer (MVP)

You need to use the Instr Function and the Left function. Probably you need to
do this after the import with an update query.

UPDATE YourImportedTable
SET YourField = LEFT(YourField,Instr(1,YourField,",")-1)
WHERE YourField Like "*,*"
 

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

Top