Update Qry Newest Date Criteria

A

Andy

Hi;

Trying to create an Update Qry to add to late fee charges.

Using tblSales and tblPayments

tblSales includes:
Sales Date
Late Fee Amount
DaysTillLateFeeAdded.

tblPayments includes:
PaymentDate
AmountOfPayment.

Have created:
IIF(isNull(tblPayments]![PaymentDate),Date()-[tblSales]![SalesDate]>=[tblSales]![DaysTillLateFeeAdded],Date()-[tblPayments]![PaymentDate]>=[tblSales]![DaysTillLateFeeAdded]
THEN
Run the Update Qry
That works correctly.

The obstacle is:
The Update qry has to calculate using the Latest Payment Date for each Sales
Record ONLY and ignore all older payments for that Sales Record.

Have tried using "qryMAXofPaymentDate" as the qryUpdate Source. Its
generates an error stating that You must use an updateable qry.

Have also tried "Query Properties" Top Value, 5%. That doesn't work because
it only shows the top 5% of Payments.

I know Criteria has to be included in the qryUpdate. So far the criteria
I've tried including:
Exp1:
IIF(isNull(tblPayments]![PaymentDate),Date()-[tblSales]![SalesDate]>=[tblSales]![DaysTillLateFeeAdded],Date()-[tblPayments]![PaymentDate]>=[tblSales]![DaysTillLateFeeAdded]
Criteria = -1 also pulls the older payments.

Can someone point me in the correct direction?

Thank You for taking the time to read this post.

Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top