Save yourself some pain and create two DB columns.  Use CF to loop over them
and re-insert the proper values.  You only need to do this once of course...


<cfquery name="myQuery">
..


<cfoutput query="myQuery">
<cfquery name="">
        INSERT INTO theTable (firstName, lastName)
        VALUES( '#listFirst(fullName," ")#', '#listLast(fullName," ")#')
..


+-----------------------------------------------+
Bryan Love
  Macromedia Certified Professional
  Internet Application Developer
  Database Analyst
Telecommunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+

"...'If there must be trouble, let it be in my day, that my child may have
peace'..."
        - Thomas Paine, The American Crisis



-----Original Message-----
From: Timothy Heald [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 9:10 AM
To: CF-Talk
Subject: RE: can this be done?


I am not sure about in Access.  In T-SQL you have functions like charindex,
and subsrtring and right, and left that would make it easy to do this all in
SQL.  Using access I don't think you have those functions, however you can
use CF to do it, and use the space as a list delimiter.  It would be time
consuming if it's a big db, and it would not scale at all :)

Tim Heald
ACP/CCFD :)
Application Development
www.schoollink.net

> -----Original Message-----
> From: Jeff Fongemie [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 13, 2002 12:05 PM
> 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
>
> 

______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to