Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2006
    Posts
    9

    Unanswered: Create table based on query and add new column

    How to add some records based on a query (all_q) to a table (small_tb) and also add a column (wekno). I tried with make-table query (new_q) but every time when run my records from table are deleted and adding a new column never succed.

    Query results(all_q):
    PRJNO ACTVW ACTMH
    4052 10 100
    4053 20 200
    4062 30 300

    table where i want to add results from query(small_tb):

    WEKNO PRJNO ACTVW ACTMH
    40 4052 10 100
    40 4053 20 200
    40 4062 30 300


    I want to make like this because every week i inqury one big table and i use only that results. That result i want to put in another table to keep, so i need one column with "week no" to make differece between weeks.

    Thanks!

  2. #2
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    If you want to keep the past results use an append query. A make table query will overwrite any existing table of the same name each time it is run.

  3. #3
    Join Date
    Oct 2006
    Posts
    26
    Couldn't you just write the code to create a new table whose name = the date it was created?
    Last edited by tlaurick; 10-19-06 at 07:42.

  4. #4
    Join Date
    Oct 2006
    Posts
    9
    To write a code is best solution...but in my case can not because i am a begginer and i dont know how to do that.
    I tried with append query..it works..but on half.

    I created a new table (weekno_tb) with no from 1 to 52. and a form with a combo box and one command button. Here i want after i selected weekno and press command button to record in small table the result from query(all_q) and weekno what i selected before.
    Attached Files Attached Files

Posting Permissions

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