Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Joliette, Quebec, Canada
    Posts
    290
    Thanks
    9
    Thanked 0 Times in 0 Posts
    I have a summary query that has five fields each with 1 result
    field1 field2 field3 field4 field5
    100 200 250 400 150

    it need these results to be transposed so as to give two fileds

    NameOfField Results

    Field1 100
    Field2 200
    Field3 250
    Filed4 400
    Field5 150

    I need this in order to make a pie chart

  2. #2
    Star Lounger
    Join Date
    Sep 2002
    Location
    Hastings, Sussex, England
    Posts
    67
    Thanks
    0
    Thanked 1 Time in 1 Post
    Sorry, I cannot think of a way to do this in a query. Unless others can suggest a better way, you're looking at a simple bit of code.

    1. Identify a recordset to hold the result (e.g. a table, remember to empty it before starting)
    2. Open a recordset to show the source data.
    3. Go to the first (only?) record of your source data, and the first field.
    4. Read the value.
    5. Append the field name and the value to the temporary table (remember to update if using a recordset, but I'd use an Append SQL statement)
    6. Move to the second field, and repeat steps 4 and 5. Continue until you run out of fields.

    Close your recordset(s), and open the pie chart which is based on the temporary table.

    Hope this helps,

    Jules

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Unless I'm missing something obscure, you can create a pie chart from data formated like your summary query results. What version of Office are you using, and are you creating the pie chart in Access or Excel?
    Wendell

  4. #4
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Joliette, Quebec, Canada
    Posts
    290
    Thanks
    9
    Thanked 0 Times in 0 Posts
    i am using access 2003, I assumed the pie chart adresses only one field

Posting Permissions

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