Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2003
    Location
    Cleveland, Ohio
    Posts
    10

    Unanswered: text file to acess

    IDTask,OldSN,NCCAT,Monitor,DateStamp
    5247 U DT Mestek Andrea ,D70WY0 ,NCC152848,,12/16/02
    5248 U DT Tamaro Anne, 280WY01 ,NCC152866,,12/16/02
    5249 R LT Figgie Betsy,23D0NMT ,NCC141826,,12/16/02
    5250 U DT Cortez Bonita S. ,44HVY01 ,NCC152823,,12/16/02
    5251 R LT Lucido David J. ,78N5858 ,NCC159287,,12/16/02


    Here is my text file. I have been able to import this into my acess database, now the problem is, the first numbers in the IDTask field are auto numbers in another field that I have hidden. This field is called ID. This ID field is also the primary key for that table. What I need to do is find that ID number and add the data to that particular record. Any suggestions?? I have to break out the first four numbers...eventually they will turn into five or more numbers.

  2. #2
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665

    Re: text file to acess

    Originally posted by PooHunny
    IDTask,OldSN,NCCAT,Monitor,DateStamp
    5247 U DT Mestek Andrea ,D70WY0 ,NCC152848,,12/16/02
    5248 U DT Tamaro Anne, 280WY01 ,NCC152866,,12/16/02
    5249 R LT Figgie Betsy,23D0NMT ,NCC141826,,12/16/02
    5250 U DT Cortez Bonita S. ,44HVY01 ,NCC152823,,12/16/02
    5251 R LT Lucido David J. ,78N5858 ,NCC159287,,12/16/02


    Here is my text file. I have been able to import this into my acess database, now the problem is, the first numbers in the IDTask field are auto numbers in another field that I have hidden. This field is called ID. This ID field is also the primary key for that table. What I need to do is find that ID number and add the data to that particular record. Any suggestions?? I have to break out the first four numbers...eventually they will turn into five or more numbers.
    if the text file that you are importing is data that needs to be updated to exhisting data, and the key on both set of records match ie (you have 002 in the old data and a record 002 in the new data) then all you need to do is import the new data into a stage table, and run an update query joining on the primary key of the two tables.
    ie
    update old_tble
    set name = n.name
    from old_tbl o, new_tbl n
    where o.id = n.id


    hth
    Jim

  3. #3
    Join Date
    Jan 2003
    Location
    Cleveland, Ohio
    Posts
    10

    thank you

    thank you for your quick response. I will give that a try.

  4. #4
    Join Date
    Jan 2003
    Location
    Cleveland, Ohio
    Posts
    10

    almost

    ok...I took the advice given to me by Jim. The data in the field from the first table is not auto-numbered, the data in the second table is auto-numbered and is the primary key. How can I get access to look for those numbers and match them with the primary key of second table to add data to the rest of the record??

  5. #5
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665

    Re: almost

    Originally posted by PooHunny
    ok...I took the advice given to me by Jim. The data in the field from the first table is not auto-numbered, the data in the second table is auto-numbered and is the primary key. How can I get access to look for those numbers and match them with the primary key of second table to add data to the rest of the record??

    is there any type of id in the data, like a user_id or machine_name?

    if there is a primary key in both sets of data and the two keys can relate to eachother then you are good ie

    table one primary key user_id
    table two primary key user_id

    these two column can be joined on for the update

    if the data is the same then the primary key for one should be the primary key for the other.
    Jim

Posting Permissions

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