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];
<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];