Discussions

Copy columns from a table to another table in access

Tags:
+
0 Votes
Locked

Copy columns from a table to another table in access

accessissues
Hi,

Could any one help me out to copy columns from one table to another. I want to copy columns not rows*.

I inserted the data as rows and wrote a crosstab query to make them as columns. Now i want to copy them to original main table. How do i do that?

Thanks in advance.

Please help. Urgent
  • +
    0 Votes
    Tony Hopkinson

    e.g.

    Month Year Value
    April 2010 3
    May 2010 4

    CrossTab To
    Year April May
    2010 3 4

    !!! UncrossTab

    Insert Original Select 'April',Year, April
    From CrossTabbed

    Insert Original Select 'May',Year, May
    From CrossTabbed

    etc

    I guess you could write some vba to do it. I have written sql to do this sort of thing but that requires stuff that Access doesn't have and it's just as messy.

    +
    0 Votes
    CharlieSpencer

    but why would you want to do this?

    I thought the whole point of relational databases was so you could link from one table to the next. If you already have the info in one table, why would you want it in a second one?

  • +
    0 Votes
    Tony Hopkinson

    e.g.

    Month Year Value
    April 2010 3
    May 2010 4

    CrossTab To
    Year April May
    2010 3 4

    !!! UncrossTab

    Insert Original Select 'April',Year, April
    From CrossTabbed

    Insert Original Select 'May',Year, May
    From CrossTabbed

    etc

    I guess you could write some vba to do it. I have written sql to do this sort of thing but that requires stuff that Access doesn't have and it's just as messy.

    +
    0 Votes
    CharlieSpencer

    but why would you want to do this?

    I thought the whole point of relational databases was so you could link from one table to the next. If you already have the info in one table, why would you want it in a second one?