Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

queries and chart help!

Status
Not open for further replies.

devagupt

Vendor
Oct 27, 2006
40
US
I have another question in queries and charts. I ran a query to count the number of records present in a field and sorted it in ascending order. WHen i make the chart , it doesnt display it in ascending order , i wonder why.Below is the code. I was trying to make a pareto chart which would display our downtime type from the highest to the lowest but for some reason it displays as is.Help please!

SELECT tblDowntimeTable.Shift, tblDowntimeTable.Type01, Count(tblDowntimeTable.Type01) AS CountOfType01
FROM tblDowntimeTable
GROUP BY tblDowntimeTable.Shift, tblDowntimeTable.Type01, DatePart("ww",[tblDowntimeTable]![Date01])
HAVING (((tblDowntimeTable.Shift)=2))
ORDER BY Count(tblDowntimeTable.Type01);
 
What is the exact Row Source property of the Chart control?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
The Row source property is
SELECT [Type01],Sum([CountOfType01]) AS [SumOfCountOfType01] FROM [DowntimebyType] GROUP BY [Type01];
 
You don't have any ORDER BY in your Row Source so you can't count on it being in any particular order.

Try:
Code:
SELECT [Type01],Sum([CountOfType01]) AS [SumOfCountOfType01] 
FROM [DowntimebyType]   
GROUP BY [Type01]
ORDER BY Sum([CountOfType01]);

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top