[AccessD] Sequence number in query

Gustav Brock Gustav at cactus.dk
Sat Jan 21 12:26:31 CST 2006


Hi Rocky

If you don't have that many records this simple method may do if you have some unique key:

  SELECT 
    *,
      (SELECT 
        COUNT(*) 
      FROM 
        tblTable AS T 
      WHERE 
        T.[key] <= tblTable.[key];) AS 
    SeqID
  FROM 
    tblTable
  GROUP BY 
    tblTable.[key]
  ORDER BY 
    tblTable.[key];

/gustav

>>> bchacc at san.rr.com 21-01-2006 18:32:21 >>>
Dear List:

There is a trick to creating a column in a query with a sequence number 
1, 2, 3, 4... but I can't remember what it is.  Does anyone recall this?

MTIA

-- 
Rocky Smolin
Beach Access Software
858-259-4334
www.e-z-mrp.com 





More information about the AccessD mailing list