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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does any one know how i would sort (ORDER BY) the following query so t

Status
Not open for further replies.

Radman

Programmer
Jan 20, 2000
22
AU
Does any one know how i would sort (ORDER BY) the following query so that the records appear in ascending order according to the values return by: Count(F.[Failure Code Number])<br>
<br>
<br>
SELECT TOP 10 F.[Failure Code Number], Count(F.[Failure Code Number]) AS [Number of Occurances]<br>
FROM Failure AS F, Complaint AS C, Plant AS P<br>
WHERE (((F.[Failure ID])=[C].[Failure ID])<br>
AND (P.[Company ID] = [Forms]![Choice Top 10 Type]![CompanyName]) AND<br>
(C.[PlantID] = P.[Plant ID Number]) AND<br>
(C.[Date Received] Between [Forms]![Choice Top 10 Type]![FromDate]<br>
AND [Forms]![Choice Top 10 Type]![ToDate]))<br>
GROUP BY F.[Failure Code Number];
 
in theory, (dependent on your structure), replace the ; with ORDER by [Number of Occurances] asc;<br>
<br>
Pity there isn't a spell checker in Access!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top