How to Rank a date field?

  Kiến thức lập trình

Hello Everyone I am new to SQL, Please help me with this. My table looks like this. In my table, there are multiple project names and other fields also. My requirement is to rank all project’s End Date in ascending order.
enter image description here

I tried like this but failed to achieve.
SELECT TOP [End_Date] ,[Project_Name] RANK() OVER(PARTITION BY [Project_Name] ORDER BY [End_Date]asc) Rank FROM Table_Name

New contributor

Ajit Sahoo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.