D
d.barson
Hi,
I have a table called DDPayments which contains 4 fields: PaymentID,
DDID, BankID and Date Paid. I need a query that will delete all
records, so the rows will only contain the most recent Date when a
transaction occured.
I currently have the following in the table:
ROW 1 - PaymentID: 1 DDID: 9 BankID: 1 Date Paid: 13/08/07
ROW 2 - PaymentID: 1 DDID: 9 BankID: 1 Date Paid: 13/09/07
ROW 3 - PaymentID: 1 DDID: 26 BankID: 1 Date Paid: 10/08/07
ROW 4 - PaymentID: 1 DDID: 26 BankID: 1 Date Paid: 13/09/07
ROW 5 - PaymentID: 1 DDID: 6 BankID: 1 Date Paid: 13/08/07
(This table is updated with an append query.)
I therefore need to delete rows1 and 3 as these are the oldest records
and not needed.
The reason I need this is because I have written a database for my
bank accounts and I have a form to show regular payments such as
direct debits. This form needs to show when a payment was last paid
and when it is due to be paid again. This is why I have created the
table above, to show when the payment was last paid. Hope all of this
makes sense!
I have a table called DDPayments which contains 4 fields: PaymentID,
DDID, BankID and Date Paid. I need a query that will delete all
records, so the rows will only contain the most recent Date when a
transaction occured.
I currently have the following in the table:
ROW 1 - PaymentID: 1 DDID: 9 BankID: 1 Date Paid: 13/08/07
ROW 2 - PaymentID: 1 DDID: 9 BankID: 1 Date Paid: 13/09/07
ROW 3 - PaymentID: 1 DDID: 26 BankID: 1 Date Paid: 10/08/07
ROW 4 - PaymentID: 1 DDID: 26 BankID: 1 Date Paid: 13/09/07
ROW 5 - PaymentID: 1 DDID: 6 BankID: 1 Date Paid: 13/08/07
(This table is updated with an append query.)
I therefore need to delete rows1 and 3 as these are the oldest records
and not needed.
The reason I need this is because I have written a database for my
bank accounts and I have a form to show regular payments such as
direct debits. This form needs to show when a payment was last paid
and when it is due to be paid again. This is why I have created the
table above, to show when the payment was last paid. Hope all of this
makes sense!