Results 1 to 6 of 6
  1. #1
    Join Date
    May 2006
    Posts
    3

    Unanswered: Creating a table from a crosstab query

    How do you create a table as the result of a crosstab query?

    The problem that I have is actually more complex. I want to generate a graphic inside a form based on a crosstab query. I want to be able to select a value from a combo box that will determine the graphic that will be displayed. This value will be used as a select criterium in the crosstab query. I know how to do this with a normal query. Unfortunately, it doesn't seem to be possible with a crosstab query (any thoughts???). I think I can solve the problem simply by using a table as the source of the graphic, but to achieve this I need the output of my crosstab query to be stored as a table.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    wait, i know this one (never did it myself, though) --
    Code:
    select * into newtable
      from ( crosstab query goes here ) as T
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    May 2006
    Posts
    3
    Doesn't seem to work. I get the error message "syntax error in from clause"... What exactly is the bracketing I should use for the crosstab query itself (between FROM and AS).

  4. #4
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,420
    Provided Answers: 7
    what i do is
    1 first create the query the make the Crosstab
    2 then create a mk table that read the Crosstab query

    then Run 2 which will run 1 and then make the table
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    sorry, i remembered it wrong, myle has the right answer

    save the crosstab query, then run
    Code:
    select * into newtable
      from crosstab_query
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    Join Date
    May 2006
    Posts
    3
    It works! Quite simple actually. Thank you guys.

Posting Permissions

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