I would like create a data query in SQL to incrementally number groups of rows, grouped on a common datetime and keep the “group numbers” incrementing on the next datetime and so on. These “group numbers” must not reset for each group as I have seen when using the partition by statement. Here is my sample data:

select hl.ts_DateTime, hl.Tagname as [ID], hl.TagValue as [Value],
ROW_NUMBER() OVER (PARTITION BY hl.ts_datetime ORDER BY hl.tagname) AS RowFilter
from Table1 hl

So basically, looking at the RowFilter column, I am getting a unique ROW number per ts_DateTime partition. What I actually need is that for each ts_DateTime partition the RowFilter column should look like the Required result column.