11/26/2024 1:24:27 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss general SalesLogix import and data migration topics. View the code of conduct for posting guidelines.
|
|
|
|
Splitting a contact name
Posted: 05 Apr 06 7:50 AM
|
fiogf49gjkf0d Hi all.
I am new to SalesLogix 6.2.1 so please bare with me. I am trying to import some new accounts and contacts via a CSV file. All of the fields import correctly, but I am having trouble with the contact name, the CSV does not split it into: LastName and FirstName but rather puts both into one field: FirstName LastName (John Doe). I am using the Import Wizard for this, I was able to concatenate the phone number and area code, but I do not know how to split, so that it goes into the proper fields in the Contact Table. Any ideas? |
|
|
|
Re: Splitting a contact name
Posted: 06 Apr 06 1:57 AM
|
fiogf49gjkf0d Hi Fabian. I have had to do this before. One method I use is to import the column that needs to be split into a temporary column. You need to use the charindex and substring T-SQL functions to split the string.
In this example all the contact names have been imported into a column in the contact table named "tempconname".
To get the firstname you would run something like this
UPDATE CONTACT SET CONTACT.FIRSTNAME = LEFT(TEMPCONNAME, CHARINDEX(' ', TEMPCONNAME))
This sets the contact.firstname field to the first string of characters in the column before a space is encountered. This assumes that your contact name is in the format firstname(space)lastname. If you have titles (e.g. Mr. Mrs. etc..) you will need to modify the statement.
To get the lastname
UPDATE CONTACT SET CONTACT.LASTNAME = SUBSTRING(TEMPCONNAME, CHARINDEX(' ', TEMPCONNAME)+1, LEN(TEMPCONNAME))
The substring function required three arguments (expression, start, length) in this case our expression is the column tempconname. The start point is the index position of the first space + 1. (This saves running a further ltrim update later to remove extraneous spaces). The length of the substring is just the length of the entire column. This will insert some spaces in the lastname column, so you may also need to run:
UPDATE CONTACT SET CONTACT.LASTNAME = RTRIM(CONTACT.LASTNAME)
or just play around with the sting functions until you find a way that works.
You can test and experiment with the results by replacing the UPDATE statements with SELECT statements. Also the BooksOnline T-SQL help function in the SQL Query Analyser tool contains more in depth details about the various SQL string functions.
Good Luck
|
|
|
|
Re: Splitting a contact name
Posted: 06 Apr 06 9:09 AM
|
fiogf49gjkf0d Originally posted by Fabian Garcia
Hi all. ... FirstName LastName (John Doe). I am using the Import Wizard for this |
|
The Import Wizard has functions to split a combined name field into first, last, middle, as well as prefix and suffix. Is this not working for you?
|
|
|
|
Re: Splitting a contact name
Posted: 06 Apr 06 9:18 AM
|
fiogf49gjkf0d I was not aware those functions existed, when I called SalesLogix Technical Support they were not able to help me either. Where could I find those functions to split? |
|
|
|
Re: Splitting a contact name
Posted: 06 Apr 06 9:37 AM
|
fiogf49gjkf0d Go through Import Wizard openning screens until you get to the screen for Field Mapping into the Contact table. Drag your combined Name field on the left onto the LastName field on the right. Drag it again onto the FirstName field. If your combined name might contain a middle name or prefix (Dr., Mr., etc.) or suffix (Jr., Esq., etc.) then drag the combined name field onto those fields as well.
Hightlight the new entry that is now indented under the LastName field. Double click it or click the View/Modify button (red cross in circle). In the middle Value area click the Edit button. The top Field Value section should be selected. If not, select it. Your combined name field name will be in the Field field (is that clear? ). Click the down arrow on the right side of the Function field and select LastName function. Click OK a couple of time and repeat for FirstName and the other name parts.
|
|
|
|
Re: Splitting a contact name
Posted: 06 Apr 06 10:32 AM
|
buy abortion pill kit online cheap buy the abortion pill ru486 online click fiogf49gjkf0d It worked! Thank you very much! |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|