Calculating #days between 2 records same field

PMrider

Registered User.
Local time
Today, 21:51
Joined
Feb 22, 2002
Messages
11
I'm building a database for deliveries. I want to be able to calculate the number of days between deliveries using just the [DateOfDelivery] field. Each delivery is a separate record on the form.
 
First you have to select the Delivery dates from the records you want to work with. Dlookup should do for that.

Then use the DateDiff function (see Access help for the syntax).

Alex

[This message has been edited by Alexandre (edited 02-22-2002).]
 
This is what I came up with and it doesn't work. I'm not really understanding how do I do a lookup on the next or previous records to put in the current record so I can use the DateDiff
=DLookUp("[DateOfDelivery]","F_Delivery Subform","[DateOfDelivery] = Forms!F_Delivery Subform")


Pleae help....I've been trying to get this to do this for weeks now and today I finally came here....thanks
 
Look up the PrevRecVal function I'm sure it's what your looking for.
HTH
 
I tried to lookup PrevRecVal in my help screens and could not find it anywhere. I have Access 2000. Is it somewhere else?
 
I'm very new to VB and i'm not sure how to do the recordsetclone or the FindNext. I'm wanting to use an unbound textbox to display the next record's DateOfDelivery on the current record. since my underlying query has my records sorting decending so I can show the most current delivery first. I've never used recordsetclone or FindNext. If anyone can give me an example of these and how to attached it to the unbound textbox would be greatly appreciated. If anyone wants me to email them the program so you can see what i'm talking about or want to have a crack at it will also be greatly appreciated. this is my last thing I have to do to this program to make it complete......THANKS to everyone for the help....

Frustrated.
Alan
 
On further examination, the code in the topic I posted above IS the use of recordsets and FindPrevious to calculate PrevRecVal. Read there and see if you can follow what it does. I was going to recreate it but there seems no point in reinventing the wheel (though I'm still looking for the help file, if this is supposed to be a standard Access function).

David R
 

Users who are viewing this thread

Back
Top Bottom