Something like
SELECT MemberID FROM MemberInstalments
WHERE InstalmentDueDate < getdate() AND NOT (InstalmentPaid = 'true')
GROUP BY MemberID
HAVING COUNT(*) >= 3
>
>I have a membership database. With a members table and a payments table
>
>Members can now pay by monthly instalments.
>If they've elected to do that then the payments table has 12 due payments set up for the member and as they pay those payments are marked as paid.
>
>I want to suspend any member who has not paid their last 3 monthly instalments.
>
>So I'm going to have a regular scheduled job that goes through and suspends members member.
>
>What query do I want to find members whose last 3 payments are still marked as due.
>
>Thanks
>
>Nick
--sb--