ranking

charlee63

Board Regular
Joined
Jan 7, 2010
Messages
146
I am trying to Rank in Access.

Here is the Data.

[TABLE="width: 221"]
<tbody>[TR]
[TD]SNGL_SYS_ITM_ID[/TD]
[TD]END_EFCTV_DT[/TD]
[/TR]
[TR]
[TD]000000031[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]000000031[/TD]
[TD]12-Nov-18[/TD]
[/TR]
[TR]
[TD]000000031[/TD]
[TD]15-Nov-18[/TD]
[/TR]
[TR]
[TD]000000046[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]000000050[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]000000051[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]000000052[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]000000052[/TD]
[TD]16-Mar-17[/TD]
[/TR]
[TR]
[TD]000000055[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]000000070[/TD]
[TD][/TD]
[/TR]
</tbody><colgroup><col><col></colgroup>[/TABLE]

Here is the SQL

SELECT T1.[SNGL_SYS_ITM_ID], T1.[END_EFCTV_DT],
(SELECT COUNT(T1.[SNGL_SYS_ITM_ID])
FROM
[Rank Query] T2
WHERE
T2.[SNGL_SYS_ITM_ID] = T1.[SNGL_SYS_ITM_ID] ) AS Rank
FROM
[Rank Query] T1
ORDER BY [SNGL_SYS_ITM_ID], [END_EFCTV_DT]

Result

[TABLE="width: 285"]
<tbody>[TR]
[TD]SNGL_SYS_ITM_ID[/TD]
[TD]END_EFCTV_DT[/TD]
[TD]Rank[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]26-Aug-16[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]14-Sep-17[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]14-Sep-17[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]14-Sep-17[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]14-Sep-17[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]14-Sep-17[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]14-Sep-17[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]14-Sep-17[/TD]
[TD]0[/TD]
[/TR]
</tbody><colgroup><col><col><col></colgroup>[/TABLE]
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
What exactly are you trying to rank on?
 
Upvote 0

Forum statistics

Threads
1,225,738
Messages
6,186,734
Members
453,369
Latest member
juliewar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top