Difference in days

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

Guest

Hi,

I have a table that gets updated with each time a user enters the premises.
There are hundreds of users to you can imagine that the table is fairly large
in size...:

e.g.

Datestamp: 01/01/05 12:34:44
Name: BillJ

How do I obtain a list of the time difference BillJ's first entry was to the
second time he entered the premises to the third etc..... I want to do this
for all users and get a feel for the average number of days each person
enters the buidling. Some may be regular and some irregular.

Please help.

skc
 
Hi Skc,

This should accomplish what you need to do.

SELECT Entry.Name, Entry.Datestamp, Entry.Datestamp,
DMax("Datestamp","[Entry]","Name='" & [Name] & "' AND [Datestamp]< #" &
[Datestamp] & "#") AS PrevEntry, DateDiff("d",PrevEntry,[Datestamp]) AS
DayDuration
FROM Entry
ORDER BY Entry.Name, Entry.Datestamp;

Hope this will help.
 
Back
Top