Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Append tables horizontally

Discussion in 'Information Technology' started by ron1337, Jul 28, 2006.

  1. ron1337

    ron1337
    Expand Collapse
    Guest

    I have a csv linked table.
    Because of the length of data I am exporting, I need to put 3 lines
    into the table for each entry.
    The 3 lines are configured such:
    prj_01;id;size;date;time
    prj_02;id;address;city
    prj_03;id;contact;title

    Is there any way to combine these entries into one table so that they
    are all on the same line?

    Regards, Ron
     
  2. Loading...

    Similar Threads Forum Date
    India 11 Constables Get Pregnant at Training School Breaking News Apr 26, 2011
    Warm Up with Winter Vegetables (Vegetarian Casseroles) Cooking & Recipies Feb 7, 2011
    India Two constables arrested for beating, extortion Breaking News Jul 27, 2010
    History Cleaning Out the Augean Stables Punjab, Punjabi, Punjabiyat Aug 25, 2009
    Sikh News Cold weather damages sugarcane, vegetables in Punjab (New Kerala) Breaking News Feb 1, 2008

  3. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On 15 Jun 2006 08:47:22 -0700, "ron1337"
    <ron.heigh@globaldetailing.com> wrote:

    >I have a csv linked table.
    >Because of the length of data I am exporting, I need to put 3 lines
    >into the table for each entry.
    >The 3 lines are configured such:
    >prj_01;id;size;date;time
    >prj_02;id;address;city
    >prj_03;id;contact;title
    >
    >Is there any way to combine these entries into one table so that they
    >are all on the same line?
    >
    >Regards, Ron


    Well, you don't *need* to put them into one table in order to export
    them as one record. Instead, create a Query.

    I'm assuming (on the basis of insufficient information, I don't know
    how your tables are related) that you want to export one record for
    each value of the id field. If so, create a query by adding these
    three tables to the query grid. Join them by linking id in the first
    table to id in the next. This will give you one "virtual" table with
    fields from all three tables; you can do the export from this Query.

    I hope I've correctly understood your problem!

    John W. Vinson[MVP]
     
  4. Ron2006

    Ron2006
    Expand Collapse
    Guest

    Be careful of the way you join the three occurances of the same table.

    If you ALWAYS have all three for every id there is no problem.

    If you do NOT ALWAYS have all three then you will have to play with the
    link properties to make sure you get what you want. (left Join? instead
    of innerjoin?)
     
  5. ron1337

    ron1337
    Expand Collapse
    Guest

    Thank you for your help.

    I"m not sure if your advice will work though, as the 3 entries are in
    the same table, on three different rows.

    I need to append the 3 rows to the same row in my query.

    Do I need to split the 3 rows into 3 different queries, then link the
    id's to create a final query with them appended together?

    This seems to be too cumbersome, like there should be an easier way.

    Regards, Ron
     
  6. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On 16 Jun 2006 06:20:50 -0700, "ron1337"
    <ron.heigh@globaldetailing.com> wrote:

    >Thank you for your help.
    >
    >I"m not sure if your advice will work though, as the 3 entries are in
    >the same table, on three different rows.
    >
    >I need to append the 3 rows to the same row in my query.
    >
    >Do I need to split the 3 rows into 3 different queries, then link the
    >id's to create a final query with them appended together?
    >
    >This seems to be too cumbersome, like there should be an easier way.
    >
    >Regards, Ron


    You need a "Self Join" query. Add the table to the query grid three
    times; set the joins and the criteria appropriately (I don't know
    what's appropriate because I don't know the structure of your data in
    enough detail).

    John W. Vinson[MVP]
     
  7. Ron2006

    Ron2006
    Expand Collapse
    Guest

    Looking back at your table description, and your comments, I cannot
    figure out whether you are importing or exporting from that table. If
    you are importing, I do not see how you can have the three different
    formats in the same csv file. If those are three different files, that
    is a different matter.

    Since I am really confused as to what data is in what format, I will
    not really address that problem but simply describe what I was talking
    about in a more abstract way.

    open a new query and put the table and select all necessary fields from
    it.
    Sort by id, and then the prn_01(02 and 03) field
    Save as "Query base"

    Open a new query and then add queries and put "Query Base" on it three
    times.
    link 1st to 2nd by the id field
    link 2nt to 3rd by the id field
    select id and proj fields and other relative to the 01 data into the
    selected area
    put a criteria on the proj field of "prj_01"
    select id and proj fields and other relative to the 02 data from the
    second query and put them in the selected area.
    put a criteria on this proj field of "prj-02"
    select id and proj fields and other relative to the 03 data from the
    third query and put them in the selected area.
    put a criteria on this proj field of "prj-03"

    If you save and run this query it will have all the pieces of
    information in a row as if it was a single record.
    As long as there is ALWAYS an occurance of prj01 and 02 and 03 for
    every ID then it will work. I know it works for I have done this
    process multiple times.

    Ron
     
  8. ron1337

    ron1337
    Expand Collapse
    Guest

    Sorry I want't clean.
    You were correct though, I am Importing the data into my table from a
    linked csv file.
    I followed your instructions, and everything is good.

    Thanks so much for your help.

    Regards, Ron
     
  9. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On 16 Jun 2006 07:20:19 -0700, "Ron2006" <ronnemec@hotmail.com> wrote:

    >Looking back at your table description, and your comments, I cannot
    >figure out whether you are importing or exporting from that table. If
    >you are importing, I do not see how you can have the three different
    >formats in the same csv file. If those are three different files, that
    >is a different matter.


    Thanks for asking the right questions, Ron - I was totally off base!

    John W. Vinson[MVP]
     

Share This Page