query+date order

  • Thread starter Thread starter J.J.
  • Start date Start date
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.
 
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.
 
Back
Top