Results 1 to 5 of 5
  1. #1
    Join Date
    May 2003
    Posts
    9

    Question Unanswered: querying multiple tables

    Hey all,

    Another curveball has come up for me -
    I need to query multiple tables, (around 3 or 4 with fields named identically to each other) unfortunately, the problem for me is, im unsure of how to compile the results of this query in the appropriate fields. I believe this may be called a union query or something such like? If anyone has anything that could help me, give me a yell!

    Cheers

  2. #2
    Join Date
    Jul 2003
    Location
    Netherlands
    Posts
    29
    Please tell us what you want to do in more detail. "Query" multiple tables isn't specific enough.

    If you have multiple tables which contain fields with the same name, simply give them other names in your query. Like this:

    my new name: [Fieldname]

    So select your field and put a new name in front of it ending with a : . That should work.
    Bye,

    Jeroen

    A 3D editor project
    www.delgine.com

  3. #3
    Join Date
    May 2003
    Posts
    9
    Hey again,

    Yeah, i see your point - i was in a bit of a rush earlier.
    * Tables 1, 2, 3, and 4 have fields that are identically named.
    * I would like to query one field in each table (the field has the same name)
    * I need the resulting data to be under the appropriate field names, regardless of which table they came from.

    eg: Fields 1, 2, 3 etc in each table
    Would like to query, say, field 3 of each table (with the same criteria)
    Would like the results of the query to be listed under Fields 1, 2, 3 NOT like 'Table.Field 1' and the like.


    Originally posted by JeroenNL
    Please tell us what you want to do in more detail. "Query" multiple tables isn't specific enough.

    If you have multiple tables which contain fields with the same name, simply give them other names in your query. Like this:

    my new name: [Fieldname]

    So select your field and put a new name in front of it ending with a : . That should work.

  4. #4
    Join Date
    Jul 2003
    Location
    Netherlands
    Posts
    29
    So for example: let's say you have a field called "MyField" in 3 different tables. You want a query that gets the "MyField" field from all these 3 tables. This query should display 3 collumns, 1 for each table you're using. But the names of these fields should NOT be:

    Table1.MyField Table2.MyField Table3.MyField

    Is this correct?

    If so, what names would you want to give these fields?
    Bye,

    Jeroen

    A 3D editor project
    www.delgine.com

  5. #5
    Join Date
    May 2003
    Posts
    9
    Hey again,

    Yeah, mostly correct - I would like to give the fields their original title of 'MyField' BUT - the other fields also contain data that is to be viewed as part of the query. and no, there shouldnt be three columns for each query of 'myfield' - they should be all merged into one column.

    Argh, this seems to get more complicated every time i write it - sorry to be so confusing!

    Originally posted by JeroenNL
    So for example: let's say you have a field called "MyField" in 3 different tables. You want a query that gets the "MyField" field from all these 3 tables. This query should display 3 collumns, 1 for each table you're using. But the names of these fields should NOT be:

    Table1.MyField Table2.MyField Table3.MyField

    Is this correct?

    If so, what names would you want to give these fields?

Posting Permissions

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