I have a simple query that returns supplier and spend data; however, it returns thousands of records. I want to sort descending on spend value, and return only the top 50 records. How can I create a field that ranks by top spend?
I appreciate the help.
Here is my current SQL:
SELECT [Raw OPW SMD Dump].[Supplier Name], Sum([Raw OPW SMD Dump].[OPW Amount]) AS [OPW Total], [Raw OPW SMD Dump].Period
FROM [Raw OPW SMD Dump]
GROUP BY [Raw OPW SMD Dump].[Supplier Name], [Raw OPW SMD Dump].Period
HAVING ((([Raw OPW SMD Dump].Period)="2003"))
ORDER BY Sum([Raw OPW SMD Dump].[OPW Amount]) DESC;
I appreciate the help.
Here is my current SQL:
SELECT [Raw OPW SMD Dump].[Supplier Name], Sum([Raw OPW SMD Dump].[OPW Amount]) AS [OPW Total], [Raw OPW SMD Dump].Period
FROM [Raw OPW SMD Dump]
GROUP BY [Raw OPW SMD Dump].[Supplier Name], [Raw OPW SMD Dump].Period
HAVING ((([Raw OPW SMD Dump].Period)="2003"))
ORDER BY Sum([Raw OPW SMD Dump].[OPW Amount]) DESC;