essaysmith
07-11-2001, 01:53 PM
Hi, new guy here. I have a table with a date field and I need to have a field (presumably calculated) that lists the amount of time since the last record. I had thought of bringing the date from the previous record into the next record and subtracting the two, but I cannot figure out how to do it.
Any help would be appreciated, thanks
Shawn
pdx_man
07-11-2001, 02:16 PM
Check out the DateDiff function under the online Help. That should do it.
essaysmith
07-11-2001, 02:57 PM
Sorry to be a pain, but does that include finding mean time between records and not just from today, for instance:
1 01/01/01
2 01/03/01 Time between: 2 days
3 02/02/02 Time between: 30 days
etc.
joeyreyma
07-11-2001, 03:13 PM
not tested but try this:
Difference = DateDiff("d",Current_FieldDate, DMin("FieldDate","Table","FieldDate >#" & Current_FieldDate & "#")
essaysmith
07-11-2001, 03:33 PM
Thanks, but I only have the current date, or is there a way to pull the previous record value for date into the current record for comparison? Or am I missing something (wouldn't surprise me).
fmcampos
01-31-2002, 09:15 AM
I'm having the same problem...couldn't find any command that would select the previous record..
Look up the PrevRecVal function.
David R
02-26-2002, 09:48 AM
Here's the article that explains PrevRecVal (Which I keep trying to type as FindPrevCal for some reason): http://support.microsoft.com/default.aspx?scid=kb;en-us;Q101081
It also has some lower-intensity solutions using Dlookup, if your database is amicable to them.
Good luck,
David R