sequential numbering in a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I need to add a column to a query that will number the selecetd records from
1-100 etc. The table holds records sorted by date added decending. I need the
most recently added record to be number 1

many thanks
 
mcdond said:
I need to add a column to a query that will number the selecetd records from
1-100 etc. The table holds records sorted by date added decending. I need the
most recently added record to be number 1


Use a calculated field:

Num: (SELECT Count(*) FROM table As X
WHERE (<same Where clause as main query>)
AND X.datefield >= table.datefield)
 
Many thanks for that. Please see below

Num: (SELECT Count(*) FROM [release data] As X
WHERE (<same Where clause as main query>)
AND [release data]![Release date] >= [release data]![Release date])

Not sure if the above is correct "release data" is the table and "Release
date" the date field. I am not sure what you are reffering to in "(<same
Where clause as main query>)"

Many thanks.
 
That was suppose to indicate that you should Copy/Paste the
Where clause from the main query (replacing the table name
with X).
--
Marsh
MVP [MS Access]

Many thanks for that. Please see below

Num: (SELECT Count(*) FROM [release data] As X
WHERE (<same Where clause as main query>)
AND [release data]![Release date] >= [release data]![Release date])

Not sure if the above is correct "release data" is the table and "Release
date" the date field. I am not sure what you are reffering to in "(<same
Where clause as main query>)"

Many thanks.
Marshall Barton said:
Use a calculated field:

Num: (SELECT Count(*) FROM table As X
WHERE (<same Where clause as main query>)
AND X.datefield >= table.datefield)
 
Back
Top