query+date order

J

J.J.

Hi
i need a function that orders the dates in one column from min to max and
then in another column the first date gets the number 1, second =>2, third
=> 3...and so on.
any suggestions
many thanks
J.J.
 
M

Michel Walsh

Hi,



SELECT a.pk, LAST(a.DateTime), COUNT(*) As rank
FROM myTable As a INNER JOIN myTable As b
ON b.DateTime <= a.DateTime
GROUP a.pk


where pk is the primary key field of the table.
 
Top