Yes, it can be done.  But it will require manual review afterwards.

I'd probably just right a quick and dirty CF page to do this work for you (a
bit easier to understand/code than T-SQL), or if you have the skills, use
SQL directly.

However, what about cases where the name is something like "John Van Dusen"
?  Is the "Van" portion a middle name, or part of the last name?  How do you
write that logic into the code?  Hence the reason I say you need a manual
review afterwards.  (or before, to be certain you do not have any of these
situations.)

If you are going the CF route, then you might be able to use the list
functions to do this.  For instance:

<cfscript>
        sFullName = "Shawn Grover";
        sFirstName = ListGetAt(sFullName, 1, " ");
        sLastName = ListGetAt(sLastName, 2, " ");
</cfscript>

Or you can be more elaborate, and get the first name, then using the
left/right functions, strip that string from the full name, and assume the
rest is the last name.

My thoughts....

Shawn Grover


-----Original Message-----
From: Jeff Fongemie [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 10:05 AM
To: CF-Talk
Subject: can this be done?


Hello cf-talk,

  I have an existing project where a form takes a field "name" and
  inserts in in a row "name" in an Access database.

  So, we have about 1000 names in the database as one name (firstname
  lastname). Now, the client changes
  his mind, and wants to be able to sort by last name, firstname.

  Yes, this was discussed prior to, and was deemed not needed.

  Is there a way, to somehow break up the full name into 2 fields, say
  by using the space as a separator?  I would only need to do this
  once as it is an event. Could I make two new fields, last_name and
  first_name, then get the fullname, break it up using the space, then
  insert first_name, then last_name?

  Is this even possible? This would have been so much easier if client
  said yes to this at the design stage!


Best regards,
 Jeff Fongemie                          mailto:[EMAIL PROTECTED]


_____________________________________________________
Composed on Monday, May 13, 2002, at 11:55:57 AM


______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to