periodically renumbering records after appending new records

C

cterner

I have a large database (>100,000 records) of individual webpage views
for on 100 different PCs on a network. The records include pageID, PC
ID and a time/date stamp. The records are sorted first by PC ID then
time/date. I need each record to be numbered sequentially. Though I
managed to do this on the first set of records, when I append the
database with a new month of records then re-sort the records by PC ID
then time/date the record number will need to be renumbered to properly
include the new records.
How might I accomplish this renumbering after each monthly update?
 
D

David F Cox

There are various ways of assigning a sequence number to records, but the
question I have is Why?

You can sort the records into any order you desire, Why do have to know that
a particular record is the 997th in that sequence?
Another question is will that sequence number change? Will one of the new
records qualify as no 996?

We have to be exactly sure what we are trying to accomplish in order to give
our opinions as to the best way to accomplish it.
 
C

cterner

My goal for all this is I need to calculate the elapsed time for each
pageview given I only have a "CreateDate" for each pageview. So my
approach is to use a query that creates a field "RecordIDMinusOne"
which I then use to create "EndDate" -- the "CreateDate" from the next
pageview record. I then do an outer join on PC ID's and RecordID to
RecordIDMinusOne. This then allows me to calculate elapsed time by
subtracting CreateDate from EndDate.
Though I know there are probably easier ways to accomplish this, this
seems to work, but it does tie me to the need to have properly
sequenced RecordIDs and the problems of managing monthly updates.
 
C

cterner

My goal for all this is I need to calculate the elapsed time for each
pageview given I only have a "CreateDate" for each pageview. So my
approach is to use a query that creates a field "RecordIDMinusOne"
which I then use to create "EndDate" -- the "CreateDate" from the next
pageview record. I then do an outer join on PC ID's and RecordID to
RecordIDMinusOne. This then allows me to calculate elapsed time by
subtracting CreateDate from EndDate.
Though I know there are probably easier ways to accomplish this, this
seems to work, but it does tie me to the need to have properly
sequenced RecordIDs and the problems of managing monthly updates.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top