View Full Version : Splitting Data in a table


MarleneWy
10-11-2006, 10:02 PM
I have one table with the following fields
Name, Address1, Address2, Postcode

when data has been imported from Excel I have found error in the data entry
ie the excel spreadsheet contain Name, but the address has been entered into the Address1 field now I need to split into Address1 and Address 2. Please Help:confused:. I am beginner to access have never used VBA only some queries. So sorry but I will need to know exactly how to do it. Thanks so very much for your help. Sometimes a comma seperates the address but sometimes just a space

neileg
10-12-2006, 01:18 AM
Is there a character that separates the two parts of address? A comma, perhaps?

MarleneWy
10-12-2006, 03:06 PM
Is there a character that separates the two parts of address? A comma, perhaps?
Neil sometimes a comma and sometimes a space

neileg
10-13-2006, 02:50 AM
Mmm....

With a comma, you can use Instr() to find the position and then use Left() and Right to retrieve the two parts. Alternatively you can use the Split function.

Where there is no comma, just a space, then you're struggling, unless there is some other way to identify the break.

gemma-the-husky
10-13-2006, 02:01 PM
how many records have you got. if its not too many, manually edit the records to put comma separators where you need them, and then use the techniques here to split the records. you will still find some addresses have a postcodes on line 3,4,5 or even 6, but it will give yuo something to work with.