This seems to work
SELECT accountname,invoice_date, ROW_NUMBER()
OVER(PARTITION BY AccountName Order by INVOICE_DATE) as RankOrder from dbo.sagesales
where AccountName is not null
Insert help from above
But now I want to update a field called "Place" (int) in dbo_sagesales with the result ie the ranked order
alternatively I would like to extract only those that have a ROW_Number as 1?
I tried where AccountName is not null and Rankorder =1 but it didnt like it in the above query!