To display the information you could use the following. Which will probably be
fairly slow
SELECT A.Model, A.Serial, A.[Date]
, Count(B.Model) as Rank
FROM TheTable as A INNER JOIN TheTable As B
On A.Model = B.Model
and A.Serial = B Serial
AND A.[Date] <= B.[Date]
GROUP BY A.Model, A.Serial, A.Date
To update the Number in Access is going to be tediously slow. And subject to
becoming incorrect when new records are added.
UPDATE YourTable
SET [Number] = DCount("*","YourTable","Model=""" & [Model] & """ AND Serial
=""" & [Serial] & """ AND [Date]<=#" & Format([Date],"yyyy-mm-dd") & "#")
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
I have a table of 400,000 records that I want to change the numbering based
Model, Serial then Date Order
Model Serial Date Number
A 1 1/1/2005 1
A 1 1/2/2005 2
B 1 1/1/2005 1
B 1 1/2/2005 2
Can you help get me started?
Thanks