V
viskoed via AccessMonster.com
I am using Access 2003. I am trying to come up with a report that will give
me the last payment made by each retiree. Dental Payments are on a subform.
They pay either yearly, semi-annually, quarterly or yearly. I used the
"Last" statement and it seemed to work perfectly until I found that the
report wasn't correct. There were people who had made payments in June 2007
and it was showing their last payment as being in December of 2006. I am
unsure how to fix the statement below to use the Top 1 or Max to get the last
date of payment. Please help. If there may be a simpler way to do this, your
expertise and ideas are quite welcome. Thank you in advance.
SELECT [completelisting].[FirstName], [completelisting].[LastName],
[Dentalpayments].Account, [Dentalpayments].[Amtpaid], Last([Dentalpayments].
Date) AS LastOfDate, [completelisting].Inactive
FROM [completelisting] INNER JOIN [Dentalpayments] ON [completelisting].
Account = [Dentalpayments].Account
GROUP BY [completelisting].[FirstName], [completelisting].[LastName],
[Dentalpayments].Account, [Dentalpayments].[Amtpaid], [completelisting].
Inactive
ORDER BY [completelisting].[FirstName], [completelisting].[LastName];
me the last payment made by each retiree. Dental Payments are on a subform.
They pay either yearly, semi-annually, quarterly or yearly. I used the
"Last" statement and it seemed to work perfectly until I found that the
report wasn't correct. There were people who had made payments in June 2007
and it was showing their last payment as being in December of 2006. I am
unsure how to fix the statement below to use the Top 1 or Max to get the last
date of payment. Please help. If there may be a simpler way to do this, your
expertise and ideas are quite welcome. Thank you in advance.
SELECT [completelisting].[FirstName], [completelisting].[LastName],
[Dentalpayments].Account, [Dentalpayments].[Amtpaid], Last([Dentalpayments].
Date) AS LastOfDate, [completelisting].Inactive
FROM [completelisting] INNER JOIN [Dentalpayments] ON [completelisting].
Account = [Dentalpayments].Account
GROUP BY [completelisting].[FirstName], [completelisting].[LastName],
[Dentalpayments].Account, [Dentalpayments].[Amtpaid], [completelisting].
Inactive
ORDER BY [completelisting].[FirstName], [completelisting].[LastName];