SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Make Table

  1. #1
    SitePoint Member
    Join Date
    Oct 2005
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Make Table

    Can anyone tell me is it possible to get a crosstab query to save its results in a table? Please, Thanks

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    not directly, no

    however, if the volume of data is not too big, once you see the crosstab query results in datasheet view, click on the top left corner to highlight all cells, copy, then go to table, new, datasheet view, click on the top left corner, paste, et voila

    don't close the crosstab query results datasheet view just yet, because you now need to save the new table just created, open it again in design view, and systematically rename the columns from Field1, Field2, Field3, etc., to new column names that reflect the values that got cross-tabbed in that sequence

    if you know what i mean
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    forget the previous post, this is what you want to do --
    Code:
    select * into [new table] from [your crosstab query]
    please note, this solution was provided today on, ahem, another forum, by a poster known as "pootle flump"

    and now that i've seen it, i realize that i should've known it all along, so it shall henceforth be my solution too

    Last edited by r937; Jan 23, 2006 at 12:31.
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

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