M
Maggic
I thought I had a solution for this from an answer to another post .. but
sad to say I was wrong ..
I have imported some data and find that the LASTNAME field contains both
first and last names separated by a comma as in "LastName,FirstName". I
need to take the FirstName portion of the LastName field and place it in the
FirstName field and then eliminate the first name text from the LastName
field.
Here is the SQL used to try to separate first and last names.
UPDATE Contacts SET Contacts.FirstName =
Right([LastName],InStr([LastName],","))
WHERE (((Contacts.LastName) Like [LastName]="*,*"));
I get 0 records updated with this ...
I tried just using the UPDATE line and get the message that all records will
be updated (which should not be the case, as some data will not need
converting), and then get the error that there is a "type conversion"
failure .. note both fields are defined as "text".
Some help with this and also with how to delete the first name text would be
much appreciated as usual.
As an aside .. Can anyone suggest a reference manual that covers the data
manipulation functions of SQL. I have taken out "SQL in 21 days" from the
library, but find it doesn't cover data manipulation to the extent that I
appear to need.
Thanks in advance, & please excuse my ignorance of all things SQL ...
Maggic
sad to say I was wrong ..
I have imported some data and find that the LASTNAME field contains both
first and last names separated by a comma as in "LastName,FirstName". I
need to take the FirstName portion of the LastName field and place it in the
FirstName field and then eliminate the first name text from the LastName
field.
Here is the SQL used to try to separate first and last names.
UPDATE Contacts SET Contacts.FirstName =
Right([LastName],InStr([LastName],","))
WHERE (((Contacts.LastName) Like [LastName]="*,*"));
I get 0 records updated with this ...
I tried just using the UPDATE line and get the message that all records will
be updated (which should not be the case, as some data will not need
converting), and then get the error that there is a "type conversion"
failure .. note both fields are defined as "text".
Some help with this and also with how to delete the first name text would be
much appreciated as usual.
As an aside .. Can anyone suggest a reference manual that covers the data
manipulation functions of SQL. I have taken out "SQL in 21 days" from the
library, but find it doesn't cover data manipulation to the extent that I
appear to need.
Thanks in advance, & please excuse my ignorance of all things SQL ...
Maggic