Hello,
I have this table for a payment log where there are a fields such as the PaymentID, DatePaid, Name. So in this table a single person can be having many payments records with different dates. I need to search this table and get all the records older than a month but I also need only the newest from each individal.
i.e: -
If Person A has paid on Nov 1 2013 and has paid again on Dec 1 2013 I need only the record from Dec 1 2013
I got the sql stament for getting all records older than a month
but i cant figure out how to get it to remove all the records where a individual has a newer DatePaid
I have this table for a payment log where there are a fields such as the PaymentID, DatePaid, Name. So in this table a single person can be having many payments records with different dates. I need to search this table and get all the records older than a month but I also need only the newest from each individal.
i.e: -
If Person A has paid on Nov 1 2013 and has paid again on Dec 1 2013 I need only the record from Dec 1 2013
I got the sql stament for getting all records older than a month
Code:
DateDue = Month(Date) - 1 & "/" & Day(Date) & "/" & Year(Date)
str = "SELECT * FROM PaymentTable WHERE DatePaid = #" & DateDue & "# ORDER BY PaymentID, DatePaid DESC;"
adodc1.recordsource = str
adodc1.refresh