Results 1 to 9 of 9
  1. #1
    jmuirman1 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Aug 2016
    Posts
    84

    Chart

    Made a chart from a query. Months are out of order. But data in q is organized ascending - seems like the chart should follow. Any suggestions? Thanks,



    john

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,120
    Are the months in alphabetical order?
    If so, you need to sort by month number
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Show the chart RowSource SQL. If it is a CROSSTAB, you can specify the column order by specifying column headings http://allenbrowne.com/ser-67.html#ColHead

    I just did a test creating a bar chart with dates on the x-axis. Even though displaying month as MMM, they are in chronological order (May, Jun, Jul, Aug). The RowSource is a CROSSTAB created by the wizard. Doesn't even specify columns.

    TRANSFORM Count(Games.[Plate]) AS CountOfPlate
    SELECT (Format([StartDate],"mmm"" '""yy")) AS Expr1
    FROM Games
    GROUP BY (Year([StartDate])*12+Month([StartDate])-1), (Format([StartDate],"mmm"" '""yy"))
    PIVOT Games.[PlayField];
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    jmuirman1 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Aug 2016
    Posts
    84
    I placed the query in ascending order by month number - still shows months in alphabetical order.

    here is my row source: SELECT [month],Sum([CountOfID]) AS [SumOfCountOfID] FROM [2018qnew cases chart for 2018] GROUP BY [month];

    any suggestions?

    thanks,

    John

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    AFAIK, record order has no bearing on the order displayed in chart when using a simple SELECT sql as the chart data source.

    The data must be month number, not month name.

    There is no ORDER BY clause in that sql anyway.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    jmuirman1 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Aug 2016
    Posts
    84
    No way to show the months in alphabetical order? That doesn’t seem right. Is there some other way to accomplish this?

  7. #7
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,120
    You sort in month number order but display the month names

    This applies to both crosstab and non-crosstab queries used for charts

    For example this (non-crosstab) SQL sorts by year number and month number and displays months formatted as 'mmm yyyy' e.g. Feb 2018
    Code:
    SELECT (Format([UsageDate],"mmm yyyy")) AS [Month], Sum(tblAccountUsage.UsageCount) AS TotalFROM tblAccountUsage
    GROUP BY (Format([UsageDate],"mmm yyyy")), (Year([UsageDate])*12+Month([UsageDate])-1)
    ORDER BY (Year([UsageDate])*12+Month([UsageDate])-1);
    produces this chart

    Click image for larger version. 

Name:	Capture.PNG 
Views:	11 
Size:	9.1 KB 
ID:	33387

    Hopefully you can see how its done
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    So sort order does matter. Learned something new about charts, thanks Colin.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,120
    You're welcome June
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 12-25-2015, 02:41 PM
  2. Limit chart to date range , Chart isnt updating .
    By fluffyvampirekitten in forum Access
    Replies: 5
    Last Post: 06-30-2015, 12:27 AM
  3. Replies: 4
    Last Post: 04-07-2015, 11:37 AM
  4. Replies: 9
    Last Post: 01-29-2013, 06:44 PM
  5. Replies: 2
    Last Post: 07-12-2010, 05:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums