Assuming a recordsource [tblSales] with fields [Week]; [Branch] & [Sales], you could try :Hello.
Expand|Select|Wrap|Line Numbers
- SELECT S1.Week, S1.Branch, S1.Sales, Count(S2.Week) + 1 AS [Ranking]
- FROM [tblSales] AS [S1] LEFT JOIN [tblSales] AS [S2]
- ON tblSales.Week = tblSales2.Week
- AND tblSales.Sales < tblSales2.Sales
- GROUP BY S1.Week, S1.Branch
- ORDER BY S1.Week, S1.Branch
I´m a newer newbie to Access. (and SQL)
What is S1 and S2? Are these tables?
You also write about tblSales2?
Are these 3(?) tables to be created before the execution of this query?