E
Emma
I have quite a complicated query:
SELECT [Loans - Payment History].DateOfPayment, [Loans - Table].[In
Default], [Loans - Table].AmountofLoan, [Loans - Table].[Client ID], [Loans -
Table].DateofLoanAgreementSigned, [Tbl Client Information].[Last Name], [Tbl
Client Information].[First Name], [Tbl Client Information].[Session Start
Date 2], [Tbl Client Information].[Session Start Date], [Loans - Payment
History].PaymentDue
FROM ([Loans - Table] INNER JOIN [Loans - Payment History] ON [Loans -
Table].ID = [Loans - Payment History].[LoanPayment ID]) INNER JOIN [Tbl
Client Information] ON [Loans - Table].[Client ID] = [Tbl Client
Information].[Client ID]
WHERE ((([Loans - Payment History].DateOfPayment) Between [Beginning Date]
And [Ending Date]) AND (([Loans - Table].[In Default])<>(0)))
ORDER BY [Loans - Payment History].DateOfPayment DESC;
It's doing what I like however I only need the last [Loans - Payment
History].DateOfPayment date. I'm not sure if I need to use a cross tab to get
rid of the extra rows? For example Hiei Clume comes up three times as she has
3 payments I only want the last payment to appear? Thanks in advance,Emma
SELECT [Loans - Payment History].DateOfPayment, [Loans - Table].[In
Default], [Loans - Table].AmountofLoan, [Loans - Table].[Client ID], [Loans -
Table].DateofLoanAgreementSigned, [Tbl Client Information].[Last Name], [Tbl
Client Information].[First Name], [Tbl Client Information].[Session Start
Date 2], [Tbl Client Information].[Session Start Date], [Loans - Payment
History].PaymentDue
FROM ([Loans - Table] INNER JOIN [Loans - Payment History] ON [Loans -
Table].ID = [Loans - Payment History].[LoanPayment ID]) INNER JOIN [Tbl
Client Information] ON [Loans - Table].[Client ID] = [Tbl Client
Information].[Client ID]
WHERE ((([Loans - Payment History].DateOfPayment) Between [Beginning Date]
And [Ending Date]) AND (([Loans - Table].[In Default])<>(0)))
ORDER BY [Loans - Payment History].DateOfPayment DESC;
It's doing what I like however I only need the last [Loans - Payment
History].DateOfPayment date. I'm not sure if I need to use a cross tab to get
rid of the extra rows? For example Hiei Clume comes up three times as she has
3 payments I only want the last payment to appear? Thanks in advance,Emma