Monthly payment query

%3CLINGO-SUB%20id%3D%22lingo-sub-2256805%22%20slang%3D%22en-US%22%3EMonthly%20payment%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2256805%22%20slang%3D%22en-US%22%3E%3CP%3EA%20strange%20query%20question.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3ELet%E2%80%99s%20say%20I%20have%20a%20table%20containing%20people%E2%80%99s%20details%3A%3C%2FP%3E%3CP%3EPersonID%20%3D%201%3CBR%20%2F%3EFirst_Name%20%3D%20Elizabeth%3CBR%20%2F%3ESurname%20%3D%20Windsor%3C%2FP%3E%3CP%3EPersonID%20%3D%202%3CBR%20%2F%3EFirst_Name%20%3D%20Philip%3CBR%20%2F%3ESurname%20%3D%20Windsor%3C%2FP%3E%3CP%3EPersonID%20%3D%203%3CBR%20%2F%3EFirst_Name%20%3D%20Charles%3CBR%20%2F%3ESurname%20%3D%20Windsor%3C%2FP%3E%3CP%3EEtc.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EI%20send%20each%20person%20an%20invoice%20at%20the%20start%20of%20the%20finical%20year%20(01%2F04%2F21)%20for%20%C2%A312%20and%20say%20they%20can%20pay%20it%20monthly%2C%20at%20%C2%A31%20per%20month.%26nbsp%3B%20This%20arrangement%20could%20continue%20for%20many%20years.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EI%20have%20another%20table%20to%20record%20to%20record%20the%20payments%3CBR%20%2F%3EID%2C%20Date_paid%2C%20Amount%2C%20PersonID%3C%2FP%3E%3CP%3ESo%20here%20is%20the%20question.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EWhat%20would%20the%20query%20look%20like%20to%20show%20who%20was%20up%20to%20date%20with%20their%20monthly%20payments%20and%20who%20wasn%E2%80%99t%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EI%20have%20been%20trying%20many%20different%20options%20and%20was%20wondering%20if%20anyone%20could%20help%20steer%20me%20in%20the%20right%20direction.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EThank%20you%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2256805%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAccess%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

A strange query question.


Let’s say I have a table containing people’s details:

PersonID = 1
First_Name = Elizabeth
Surname = Windsor

PersonID = 2
First_Name = Philip
Surname = Windsor

PersonID = 3
First_Name = Charles
Surname = Windsor

Etc.


I send each person an invoice at the start of the finical year (01/04/21) for £12 and say they can pay it monthly, at £1 per month.  This arrangement could continue for many years.


I have another table to record to record the payments
ID, Date_paid, Amount, PersonID

So here is the question.


What would the query look like to show who was up to date with their monthly payments and who wasn’t? 


I have been trying many different options and was wondering if anyone could help steer me in the right direction.


Thank you

 

 

 

2 Replies
You need three tables not two:
Person
Invoice
InvoicePayment

Record each invoice with the InvoiceDate and the PersonID for whom it was created.

Record each invoice payment with the InvoicePaymentDate and the InvoiceID.

Query for the most recent InvoicePaymentDate in the invoice payment date and the corresponding Invoice date. Compare that MostRecentInvoicePaymentDate to the current date.

@karenlorr_uk 

 

Also, how do you calculate the due date for each installment? How do you know when they are late?