Sorting X Axis of Graph embedded in a Form

S

Sorting in a Graph

I have months defined in a table that I need on hte X axis of a graph. But
the sort order is alphabetic which does not sort by months of the year. I
have tried putting a sort order by number; but it doesn't work. How can I
sort this with Jan being the first month in the order. Apr and Aug show up
first.
 
D

Duane Hookom

You need to update the Row Source property to sort by the month number. If
you can't figure this out, come back with the Row Source SQL view.
 
S

Sorting in a Graph

I have a query defined in the Record Source with this query sorted by the
month number (Months.sort); but doesn't do the sort. I have even put in the
Order By field of the form; but no luck. Maybe I need to not have a joining
of two tables in the query to get this to work. Here's the SQL statement of
the query:

SELECT Months.sort, [Work Class Timewriting].[it Work Class], [Work Class
Timewriting].Month, [Work Class Timewriting].Hours
FROM Months INNER JOIN [Work Class Timewriting] ON Months.Month = [Work
Class Timewriting].Month
ORDER BY Months.sort;
 
S

Sorting in a Graph

Is there a way of building a chart similar to Excel by putting numbers into a
datasheet and not linking the chart to a table or query?
 
S

Sorting in a Graph

This may help: I have created a chart embedded in a form without linking the
form to a table or query. In the Chart: Graph0, it's got the Row SOurce
defined:

TRANSFORM Sum([Hours]) AS [SumOfHours] SELECT [Month] FROM
[qry_it_work_class2] GROUP BY [Month] PIVOT [it Work Class];

How can I add an Order By clause to this statement to get it to sort right.
I have tried before the Group By and at the end; My syntax must not be right
to get it to work.


Sorting in a Graph said:
I have a query defined in the Record Source with this query sorted by the
month number (Months.sort); but doesn't do the sort. I have even put in the
Order By field of the form; but no luck. Maybe I need to not have a joining
of two tables in the query to get this to work. Here's the SQL statement of
the query:

SELECT Months.sort, [Work Class Timewriting].[it Work Class], [Work Class
Timewriting].Month, [Work Class Timewriting].Hours
FROM Months INNER JOIN [Work Class Timewriting] ON Months.Month = [Work
Class Timewriting].Month
ORDER BY Months.sort;


Duane Hookom said:
You need to update the Row Source property to sort by the month number. If
you can't figure this out, come back with the Row Source SQL view.
 
D

Duane Hookom

I expect [Month] is the month name. If so, you need to go bac to
qry_it_work_class2 and add a column that is the month number so you can use
SQL like:

TRANSFORM Sum([Hours]) AS [SumOfHours]
SELECT [Month]
FROM [qry_it_work_class2]
GROUP BY [Month], MthNum
ORDER BY MthNum
PIVOT [it Work Class];


--
Duane Hookom
Microsoft Access MVP


Sorting in a Graph said:
This may help: I have created a chart embedded in a form without linking the
form to a table or query. In the Chart: Graph0, it's got the Row SOurce
defined:

TRANSFORM Sum([Hours]) AS [SumOfHours] SELECT [Month] FROM
[qry_it_work_class2] GROUP BY [Month] PIVOT [it Work Class];

How can I add an Order By clause to this statement to get it to sort right.
I have tried before the Group By and at the end; My syntax must not be right
to get it to work.


Sorting in a Graph said:
I have a query defined in the Record Source with this query sorted by the
month number (Months.sort); but doesn't do the sort. I have even put in the
Order By field of the form; but no luck. Maybe I need to not have a joining
of two tables in the query to get this to work. Here's the SQL statement of
the query:

SELECT Months.sort, [Work Class Timewriting].[it Work Class], [Work Class
Timewriting].Month, [Work Class Timewriting].Hours
FROM Months INNER JOIN [Work Class Timewriting] ON Months.Month = [Work
Class Timewriting].Month
ORDER BY Months.sort;


Duane Hookom said:
You need to update the Row Source property to sort by the month number. If
you can't figure this out, come back with the Row Source SQL view.

--
Duane Hookom
Microsoft Access MVP


:

I have months defined in a table that I need on hte X axis of a graph. But
the sort order is alphabetic which does not sort by months of the year. I
have tried putting a sort order by number; but it doesn't work. How can I
sort this with Jan being the first month in the order. Apr and Aug show up
first.
 
D

Duane Hookom

The chart can be populated with values in a datasheet. However, you would
need to write code to update these values in you want the chart values to be
dynamic.

I believe SteveA or SteveS used to post code that does this. You might want
to search http://www.groupacg.com/.
 
S

Sorting in a Graph

This worked. GREAT! Thanks for your help!!!

Duane Hookom said:
I expect [Month] is the month name. If so, you need to go bac to
qry_it_work_class2 and add a column that is the month number so you can use
SQL like:

TRANSFORM Sum([Hours]) AS [SumOfHours]
SELECT [Month]
FROM [qry_it_work_class2]
GROUP BY [Month], MthNum
ORDER BY MthNum
PIVOT [it Work Class];


--
Duane Hookom
Microsoft Access MVP


Sorting in a Graph said:
This may help: I have created a chart embedded in a form without linking the
form to a table or query. In the Chart: Graph0, it's got the Row SOurce
defined:

TRANSFORM Sum([Hours]) AS [SumOfHours] SELECT [Month] FROM
[qry_it_work_class2] GROUP BY [Month] PIVOT [it Work Class];

How can I add an Order By clause to this statement to get it to sort right.
I have tried before the Group By and at the end; My syntax must not be right
to get it to work.


Sorting in a Graph said:
I have a query defined in the Record Source with this query sorted by the
month number (Months.sort); but doesn't do the sort. I have even put in the
Order By field of the form; but no luck. Maybe I need to not have a joining
of two tables in the query to get this to work. Here's the SQL statement of
the query:

SELECT Months.sort, [Work Class Timewriting].[it Work Class], [Work Class
Timewriting].Month, [Work Class Timewriting].Hours
FROM Months INNER JOIN [Work Class Timewriting] ON Months.Month = [Work
Class Timewriting].Month
ORDER BY Months.sort;


:

You need to update the Row Source property to sort by the month number. If
you can't figure this out, come back with the Row Source SQL view.

--
Duane Hookom
Microsoft Access MVP


:

I have months defined in a table that I need on hte X axis of a graph. But
the sort order is alphabetic which does not sort by months of the year. I
have tried putting a sort order by number; but it doesn't work. How can I
sort this with Jan being the first month in the order. Apr and Aug show up
first.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top