Good day folks,
I would like some assistance with the following:
I have some data which is imported into a table automatically; the fields are fixed width and are named as follows:
Name
Address
Post Code
The name field is set to a maximum of 50 characters, the address field is set to a maximum of 150 characters and the post code field is set to a maximum of 8 characters.
The first task I have to do is to break down the Name field into 3 separate fields as follows:
strTitle
strSurname
strForname
I have a new table which has fields set up as follows:
strTitle
strSurname
strForename
strAddress Line 1
strAddress Line 2
strAddress Line3
strAddress Line 4
strPostcode
I want to append the data from the import table [tblImport] to my new table with the Name field splitting out the information from the Name field into the 3 fields in my table called tblConvertedImport.
For instance Mrs Joan Brown, from the Name field in the tblImport table should be broken down to appear as follows in the tblConvertedImport table:
strTitle Field: Mrs
strSurname Field: Brown
strForename Field: Joan
The Title field is set to a maximum of 4 characters
The Surname field is set to a maximum of 30 characters
The forename field is set to a maximum of 20 characters
How do I create an expression that identifies the spaces between the data in the Name field of my tblImport table and split each segment into separate fields for appending to my tblConvertedImport table.
I know how to concatenate several fields into one field that is the reverse of what I have above for instance I have an expression as follows:
CustomerName: [strTitle] & " " & [strInitials] & " " & [strSurname]
So from another existing table I concatenate the above three fields into one, but what I need to do is the opposite of this for some data being received electronically which is not in the desired format.
Where I am having difficulty is in writing and expression that identifies the space between the customers Title, the Surname and the Forename. So for instance the expression finds the first space and all the characters to the left are the Title part of the customers salutation, it finds the next space and all the characters from the first space to the next space are the Forename of the customers salutation and then the next space and all the characters to the right of that space are the Surname of the customers salutation.
Can this be accomplished via an expression in an append query.
Your assistance would be most appreciated.
John
I would like some assistance with the following:
I have some data which is imported into a table automatically; the fields are fixed width and are named as follows:
Name
Address
Post Code
The name field is set to a maximum of 50 characters, the address field is set to a maximum of 150 characters and the post code field is set to a maximum of 8 characters.
The first task I have to do is to break down the Name field into 3 separate fields as follows:
strTitle
strSurname
strForname
I have a new table which has fields set up as follows:
strTitle
strSurname
strForename
strAddress Line 1
strAddress Line 2
strAddress Line3
strAddress Line 4
strPostcode
I want to append the data from the import table [tblImport] to my new table with the Name field splitting out the information from the Name field into the 3 fields in my table called tblConvertedImport.
For instance Mrs Joan Brown, from the Name field in the tblImport table should be broken down to appear as follows in the tblConvertedImport table:
strTitle Field: Mrs
strSurname Field: Brown
strForename Field: Joan
The Title field is set to a maximum of 4 characters
The Surname field is set to a maximum of 30 characters
The forename field is set to a maximum of 20 characters
How do I create an expression that identifies the spaces between the data in the Name field of my tblImport table and split each segment into separate fields for appending to my tblConvertedImport table.
I know how to concatenate several fields into one field that is the reverse of what I have above for instance I have an expression as follows:
CustomerName: [strTitle] & " " & [strInitials] & " " & [strSurname]
So from another existing table I concatenate the above three fields into one, but what I need to do is the opposite of this for some data being received electronically which is not in the desired format.
Where I am having difficulty is in writing and expression that identifies the space between the customers Title, the Surname and the Forename. So for instance the expression finds the first space and all the characters to the left are the Title part of the customers salutation, it finds the next space and all the characters from the first space to the next space are the Forename of the customers salutation and then the next space and all the characters to the right of that space are the Surname of the customers salutation.
Can this be accomplished via an expression in an append query.
Your assistance would be most appreciated.
John