Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    append query (Access 2000)

    I am trying to build an append query in which all the fields from the table products1 must be appended to the table products.
    I cannot do it and am asking for help.
    Both tables have one and the same list of products, for example Nr 5 is Apples in both tables.However, the table products1 does not
    conatin the whole fields as in the table Products. For example the table products1 will contain only the following fields:
    productID, grade,France.
    In another case the table Products1 may contain the fields productID, grade,England
    I have 10 similar tables Products1 and all of them should be appended to the table Products.
    Of course the table Products contains France as well as England.
    So what i am aksing for help is the following: is it possible to give such a command that to append everything that the table Products1

    contains, without specifying which field. If i can succeed, than i willk have one and the same code or query for a lot of cases.

    So, generally speaking what i want to do is the following:

    INSERT INTO products
    SELECT products1.*
    FROM products1;
    To my regret it does not work and the values are not appended.
    May i receive some help?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: append query (Access 2000)

    You aren't going to be able to do it with a generic query. You can't append all fields in a table of one shape to all fields in a table with a different shape. If the two tables are a different shape, you have to specify the fields.
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    St. Marys, Ontario, Canada
    Posts
    270
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: append query (Access 2000)

    I guess Charlotte is saying you can't mix apples with oranges. <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

    The first time I tried to do an append query, I tried to append an autonumber which was a primary key field with another autonumber, also a primary key field. It wouldn't work. Could this be what is happening in your example?

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wetherby, Yorkshire, England
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: append query (Access 2000)

    I haven't tried it for a while but I'm pretty sure you can append (say) the first 3 columns (fields) of one table provided they match the first 3 columns of the append table. The query then ignores all other columns. If France and England are different fields try 2 separate append queries doing say France first then moving the England field into column 3 (in both tables) and running the query again.
    Peter Herworth

Posting Permissions

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