2011-09-13

Microsoft Access 2010 - Rank function equivalent turnaround


SELECT DISTINCT
      T1.PeriodDate    
      , (
            SELECT
                  COUNT(*)
            FROM
                  (
                        select distinct
                              PeriodDate
                        from
                              TABLE1
                  ) as N2
            WHERE
                  N2.PeriodDate >= T1.PeriodDate
      ) AS Rank  
FROM
      TABLE1 AS T1
ORDER BY
      T1.PeriodDate DESC
;

No comments:

Post a Comment