Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Posts
    156

    Unanswered: Append Queries and Code

    Good day all!

    I'm trying to port some employee information over from an older database that doesn't have the information in exactly the same type of format as I need it in.

    For example, I have first name, middle initial and last name fields. The older database has just a name field with the name in the "lastname, firstname MI" format. Is there any way that, through code and/or append queries, that I could convert their whole name field to the individual fields?

    Obviously, there's a clear pattern in every name. You can grab everything before the comma for the last name. Everything after the comma-space to the second space for the first name and then whatever's left to the MI, if there is one. I know I could use code, left$ and similar things, to sort through a string, but I'm unsure how to do it within a query going through hundreds of records.

    Your help would be greatly appreciated!
    DocX

    The teachings of God's Begotten: 2 John 1:9

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    You can determine the position of the Comma and the space using the Instr, thenyou can use the Mid$ twice, one to extract the words till the comma , and one to extract the word form the comma +1 till the space

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •