Calulate days between dates in a recordset !

ponneri

Registered User.
Local time
Tomorrow, 01:07
Joined
Jul 8, 2008
Messages
102
Hi guys,

I am new to this forum. I checked all date related posts but my problem appears unique. Can someone help, please :o

I have a small access 2003 appl. that keeps track of monthly instalments paid by a customer.

From the beginning of the recordset till the end, I want to run through and find the number of times he has defaulted. (i.e has a payment gap of more than 60 days between any two dates in sequence)

Simply said, if he has not paid for over two months consecutively...he is a defaulter.

How do I do this ? My appl. is almost complete but for this small issue. I need to show the result as query and later in a report for printing also.

Suggest me a simple way please. It's very urgent !! :confused:

Thanks.
 
Hmz, not making a payment for 2 months... How does that default him???
Arent payments linked to invoices normaly? Then the time between invoice and payment should be leading not the 2 months between payments.

Anyhow... A less than perfect, but quick working solution:
Code:
Public dateStorage As Date

Function KeepDate(ThisDate) As Date
    If ThisDate > dateStorage Then
        KeepDate = dateStorage
    Else
        KeepDate = 0
    End If
    dateStorage = ThisDate
End Function
Paste above code into a module, then use the KeepDate function to store the current date and retrieve the previous one.

Again this is a quick fix... not perfect or technicaly advanced, but it works. You can then use functions like datediff to determain the difference.

Good Luck
 

Users who are viewing this thread

Back
Top Bottom