Case 3: calculating dues

For 2027 the committee redefines who counts as junior, and each member pays the base fee of their group plus the extra fees of their sections.

In short: Group2027: IIf(2027-Year([BirthDate])<=17,"Junior","Adult"). The dues are BaseFee + Nz((SELECT Sum(ExtraFee) … WHERE x.MemberID = m.MemberID), 0); without Nz they would be empty for members without a section.

Task 1: group by year of birth

Task From 2027 the junior group should follow from the year of birth: junior is anyone who turns 17 or younger in 2027, everyone else is adult. For active members, show FirstName, LastName, BirthDate and Group2027, sorted by LastName.

Members 60 rows, 10 columns
MemberIDFirstNameLastNameBirthDatePostalCodeCityEmailJoinedLeftOnFeeGroup
1ChloeWright8 Jan 2010LS6 2ABLeedschloe.wright1@example.com25 Jan 2026Junior
2RubyClark12 Nov 2016BD1 1HYBradfordruby.clark2@example.com7 Mar 2023Junior
3LiamWright19 Jan 1978LS11 5QALeedsliam.wright3@example.com5 May 2009Adult
4MiaSmith14 Jun 1963LS6 2ABLeeds1 Mar 2001Adult
5JackWalker16 Apr 1971LS11 5QALeedsjack.walker5@example.com24 Feb 2015Adult
6RubyWalker19 May 1960LS1 1URLeedsruby.walker6@example.com8 Feb 19801 Sep 2025Adult
7SophiaHughes24 Jun 1955LS11 5QALeedssophia.hughes7@example.com24 Jan 2008Adult
8SophiaTaylor19 Jul 1988LS1 1URLeedssophia.taylor8@example.com7 May 1997Social
9MiaKing14 Jun 2014LS11 5QALeedsmia.king9@example.com23 Jun 2025Junior
10AvaTaylor3 Apr 2011LS11 5QALeedsava.taylor10@example.com27 Dec 2018Junior
11LucasJohnson20 Jan 1997WF1 1HAWakefieldlucas.johnson11@example.com9 Sep 2025Adult
12LucasBrown7 Jan 1950LS11 5QALeedslucas.brown12@example.com15 May 2016Adult
13ChloeDavies22 Oct 1980WF1 1HAWakefield24 Jul 2024Social
14OliviaWalker11 Oct 1955LS1 1URLeedsolivia.walker14@example.com23 Nov 1981Adult
15HenryBrown23 Mar 2012BD1 1HYBradfordhenry.brown15@example.com12 Aug 2024Junior
16ChloeClark8 Jan 1949LS11 5QALeedschloe.clark16@example.com28 Mar 2003Social
17LeoHughes4 Apr 1971LS1 1URLeedsleo.hughes17@example.com11 Nov 199927 Apr 2026Adult
18HenryTaylor15 May 2002WF1 1HAWakefieldhenry.taylor18@example.com2 Jan 2011Concession
19HenryTaylor24 Mar 2011BD1 1HYBradfordhenry.taylor19@example.com28 Dec 2018Junior
20SophiaKing11 Oct 1994BD1 1HYBradfordsophia.king20@example.com1 Sep 1986Adult
21GraceBaker4 Nov 2011LS6 2ABLeedsgrace.baker21@example.com31 May 2018Junior
22NoahEvans2 Nov 2017BD1 1HYBradford25 Jul 2026Junior
23JamesHughes23 Jan 2003LS1 1URLeedsjames.hughes23@example.com20 Oct 2014Concession
24JamesTaylor17 Apr 2013BD1 1HYBradfordjames.taylor24@example.com4 Nov 2019Junior
25LucasHall4 Dec 1952BD1 1HYBradfordlucas.hall25@example.com5 May 1996Social
26HenrySmith28 Dec 1990BD1 1HYBradfordhenry.smith26@example.com15 Dec 2020Concession
27EmmaHughes26 Apr 1948WF1 1HAWakefieldemma.hughes27@example.com1 May 1987Adult
28EmmaGreen25 Jan 2014WF1 1HAWakefieldemma.green28@example.com15 Feb 2025Junior
29JamesBaker23 Jan 1978LS11 5QALeedsjames.baker29@example.com8 Apr 20129 Jul 2025Concession
30SamGreen16 Apr 2003LS6 2ABLeedssam.green30@example.com21 Apr 2021Adult
31SamWilson28 Aug 1996LS1 1URLeeds8 Aug 2024Adult
32ChloeHall11 Dec 2000LS6 2ABLeedschloe.hall32@example.com17 Sep 2021Adult
33SamWilson19 Oct 2018LS6 2ABLeedssam.wilson33@example.com24 Nov 2024Junior
34EmmaWright8 Mar 1981WF1 1HAWakefieldemma.wright34@example.com27 Aug 1999Adult
35SophiaWard3 Feb 1973LS6 2ABLeedssophia.ward35@example.com24 Aug 2009Adult
36LiamEvans15 Oct 1959LS1 1URLeedsliam.evans36@example.com2 Nov 2025Adult
37NoahBrown4 Dec 1985BD1 1HYBradfordnoah.brown37@example.com26 Oct 2023Adult
38GraceClark3 Apr 2000WF1 1HAWakefieldgrace.clark38@example.com18 Jul 2026Adult
39SamDavies3 Feb 1957BD1 1HYBradfordsam.davies39@example.com21 Sep 2013Concession
40OliverBrown16 Dec 1990BD1 1HYBradford11 Jun 2022Social
41NoahWalker8 Jun 1950LS6 2ABLeedsnoah.walker41@example.com5 Jun 2001Adult
42JackGreen26 Nov 2010LS11 5QALeedsjack.green42@example.com5 Nov 2021Junior
43LiamClark1 Jun 2016WF1 1HAWakefieldliam.clark43@example.com26 Oct 2026Junior
44GraceWalker5 Jan 2016LS11 5QALeedsgrace.walker44@example.com14 May 202216 Aug 2025Junior
45JamesTaylor27 Aug 1958LS6 2ABLeedsjames.taylor45@example.com6 Mar 2026Concession
46LeoSmith20 Jan 1948LS1 1URLeedsleo.smith46@example.com2 Jul 2000Social
47SophiaBrown9 Feb 2013LS6 2ABLeedssophia.brown47@example.com17 Mar 2023Junior
48JackGreen26 Dec 1976LS11 5QALeedsjack.green48@example.com17 Feb 2022Adult
49EmmaWard21 Feb 2000LS6 2ABLeeds27 Mar 2024Adult
50NoahBaker21 Jul 1965LS11 5QALeedsnoah.baker50@example.com21 May 1982Adult
51EllaKing10 Oct 1973LS1 1URLeedsella.king51@example.com27 Nov 1998Social
52LucasWilson5 Jul 2014WF1 1HAWakefieldlucas.wilson52@example.com21 Aug 2026Junior
53EmmaBrown21 Jun 1948WF1 1HAWakefieldemma.brown53@example.com17 Dec 2013Concession
54NoahWalker3 Mar 2010WF1 1HAWakefieldnoah.walker54@example.com26 Aug 2026Junior
55RubySmith12 Sep 1964LS11 5QALeedsruby.smith55@example.com4 Nov 2017Concession
56SamWalker1 Apr 2013LS6 2ABLeedssam.walker56@example.com17 Sep 2021Junior
57MiaWright18 Feb 2018LS6 2ABLeedsmia.wright57@example.com6 Apr 2025Junior
58EllaJohnson26 May 1976LS6 2ABLeeds23 Aug 2009Adult
59EmmaWright7 Sep 1998LS6 2ABLeedsemma.wright59@example.com28 Aug 2020Adult
60NoahBrown16 Mar 1951LS11 5QALeedsnoah.brown60@example.com12 Apr 2005Social

The lesson on calculated fields shows IIf.

Task 2: dues per member

Task The 2027 dues per active member are the base fee of the fee group plus the extra fees of all the member's sections. Show MemberID, LastName and Dues, sorted by MemberID. Social members without a section pay only the base fee.

Members 60 rows, 10 columns
MemberIDFirstNameLastNameBirthDatePostalCodeCityEmailJoinedLeftOnFeeGroup
1ChloeWright8 Jan 2010LS6 2ABLeedschloe.wright1@example.com25 Jan 2026Junior
2RubyClark12 Nov 2016BD1 1HYBradfordruby.clark2@example.com7 Mar 2023Junior
3LiamWright19 Jan 1978LS11 5QALeedsliam.wright3@example.com5 May 2009Adult
4MiaSmith14 Jun 1963LS6 2ABLeeds1 Mar 2001Adult
5JackWalker16 Apr 1971LS11 5QALeedsjack.walker5@example.com24 Feb 2015Adult
6RubyWalker19 May 1960LS1 1URLeedsruby.walker6@example.com8 Feb 19801 Sep 2025Adult
7SophiaHughes24 Jun 1955LS11 5QALeedssophia.hughes7@example.com24 Jan 2008Adult
8SophiaTaylor19 Jul 1988LS1 1URLeedssophia.taylor8@example.com7 May 1997Social
9MiaKing14 Jun 2014LS11 5QALeedsmia.king9@example.com23 Jun 2025Junior
10AvaTaylor3 Apr 2011LS11 5QALeedsava.taylor10@example.com27 Dec 2018Junior
11LucasJohnson20 Jan 1997WF1 1HAWakefieldlucas.johnson11@example.com9 Sep 2025Adult
12LucasBrown7 Jan 1950LS11 5QALeedslucas.brown12@example.com15 May 2016Adult
13ChloeDavies22 Oct 1980WF1 1HAWakefield24 Jul 2024Social
14OliviaWalker11 Oct 1955LS1 1URLeedsolivia.walker14@example.com23 Nov 1981Adult
15HenryBrown23 Mar 2012BD1 1HYBradfordhenry.brown15@example.com12 Aug 2024Junior
16ChloeClark8 Jan 1949LS11 5QALeedschloe.clark16@example.com28 Mar 2003Social
17LeoHughes4 Apr 1971LS1 1URLeedsleo.hughes17@example.com11 Nov 199927 Apr 2026Adult
18HenryTaylor15 May 2002WF1 1HAWakefieldhenry.taylor18@example.com2 Jan 2011Concession
19HenryTaylor24 Mar 2011BD1 1HYBradfordhenry.taylor19@example.com28 Dec 2018Junior
20SophiaKing11 Oct 1994BD1 1HYBradfordsophia.king20@example.com1 Sep 1986Adult
21GraceBaker4 Nov 2011LS6 2ABLeedsgrace.baker21@example.com31 May 2018Junior
22NoahEvans2 Nov 2017BD1 1HYBradford25 Jul 2026Junior
23JamesHughes23 Jan 2003LS1 1URLeedsjames.hughes23@example.com20 Oct 2014Concession
24JamesTaylor17 Apr 2013BD1 1HYBradfordjames.taylor24@example.com4 Nov 2019Junior
25LucasHall4 Dec 1952BD1 1HYBradfordlucas.hall25@example.com5 May 1996Social
26HenrySmith28 Dec 1990BD1 1HYBradfordhenry.smith26@example.com15 Dec 2020Concession
27EmmaHughes26 Apr 1948WF1 1HAWakefieldemma.hughes27@example.com1 May 1987Adult
28EmmaGreen25 Jan 2014WF1 1HAWakefieldemma.green28@example.com15 Feb 2025Junior
29JamesBaker23 Jan 1978LS11 5QALeedsjames.baker29@example.com8 Apr 20129 Jul 2025Concession
30SamGreen16 Apr 2003LS6 2ABLeedssam.green30@example.com21 Apr 2021Adult
31SamWilson28 Aug 1996LS1 1URLeeds8 Aug 2024Adult
32ChloeHall11 Dec 2000LS6 2ABLeedschloe.hall32@example.com17 Sep 2021Adult
33SamWilson19 Oct 2018LS6 2ABLeedssam.wilson33@example.com24 Nov 2024Junior
34EmmaWright8 Mar 1981WF1 1HAWakefieldemma.wright34@example.com27 Aug 1999Adult
35SophiaWard3 Feb 1973LS6 2ABLeedssophia.ward35@example.com24 Aug 2009Adult
36LiamEvans15 Oct 1959LS1 1URLeedsliam.evans36@example.com2 Nov 2025Adult
37NoahBrown4 Dec 1985BD1 1HYBradfordnoah.brown37@example.com26 Oct 2023Adult
38GraceClark3 Apr 2000WF1 1HAWakefieldgrace.clark38@example.com18 Jul 2026Adult
39SamDavies3 Feb 1957BD1 1HYBradfordsam.davies39@example.com21 Sep 2013Concession
40OliverBrown16 Dec 1990BD1 1HYBradford11 Jun 2022Social
41NoahWalker8 Jun 1950LS6 2ABLeedsnoah.walker41@example.com5 Jun 2001Adult
42JackGreen26 Nov 2010LS11 5QALeedsjack.green42@example.com5 Nov 2021Junior
43LiamClark1 Jun 2016WF1 1HAWakefieldliam.clark43@example.com26 Oct 2026Junior
44GraceWalker5 Jan 2016LS11 5QALeedsgrace.walker44@example.com14 May 202216 Aug 2025Junior
45JamesTaylor27 Aug 1958LS6 2ABLeedsjames.taylor45@example.com6 Mar 2026Concession
46LeoSmith20 Jan 1948LS1 1URLeedsleo.smith46@example.com2 Jul 2000Social
47SophiaBrown9 Feb 2013LS6 2ABLeedssophia.brown47@example.com17 Mar 2023Junior
48JackGreen26 Dec 1976LS11 5QALeedsjack.green48@example.com17 Feb 2022Adult
49EmmaWard21 Feb 2000LS6 2ABLeeds27 Mar 2024Adult
50NoahBaker21 Jul 1965LS11 5QALeedsnoah.baker50@example.com21 May 1982Adult
51EllaKing10 Oct 1973LS1 1URLeedsella.king51@example.com27 Nov 1998Social
52LucasWilson5 Jul 2014WF1 1HAWakefieldlucas.wilson52@example.com21 Aug 2026Junior
53EmmaBrown21 Jun 1948WF1 1HAWakefieldemma.brown53@example.com17 Dec 2013Concession
54NoahWalker3 Mar 2010WF1 1HAWakefieldnoah.walker54@example.com26 Aug 2026Junior
55RubySmith12 Sep 1964LS11 5QALeedsruby.smith55@example.com4 Nov 2017Concession
56SamWalker1 Apr 2013LS6 2ABLeedssam.walker56@example.com17 Sep 2021Junior
57MiaWright18 Feb 2018LS6 2ABLeedsmia.wright57@example.com6 Apr 2025Junior
58EllaJohnson26 May 1976LS6 2ABLeeds23 Aug 2009Adult
59EmmaWright7 Sep 1998LS6 2ABLeedsemma.wright59@example.com28 Aug 2020Adult
60NoahBrown16 Mar 1951LS11 5QALeedsnoah.brown60@example.com12 Apr 2005Social
FeeGroups 4 rows, 2 columns
FeeGroupBaseFee
Adult120.00
Junior60.00
Concession80.00
Social40.00
SectionMembers 68 rows, 3 columns
MemberIDSectionIDSince
1325 Jan 2026
229 Jan 2024
3121 Nov 2015
421 Mar 2014
546 Sep 2020
6516 Jan 2018
7324 Oct 2010
9223 Jun 2025
10227 Dec 2018
1119 Sep 2025
12211 Dec 2022
1427 Mar 2019
15312 Aug 2024
17522 Nov 2015
1832 Jan 2011
18130 Oct 2024
19428 Dec 2018
1928 Jul 2021
2046 Oct 2007
21431 May 2018
21331 May 2018
22325 Jul 2026
22225 Jul 2026
2329 Oct 2025
23520 Oct 2014
2434 Nov 2019
24417 Dec 2022
26529 Jan 2026
27221 May 2021
28215 Feb 2025
29427 Sep 2026
30421 Apr 2021
30521 Apr 2021
3138 Aug 2024
3128 Aug 2024
32413 Oct 2026
33224 Nov 2024
34129 Sep 2020
35527 Mar 2010
3612 Nov 2025
3652 Nov 2025
37426 Oct 2023
38518 Jul 2026
38218 Jul 2026
3927 Oct 2026
41520 May 2026
41215 Dec 2015
4225 Nov 2021
43226 Oct 2026
44419 May 2024
44214 May 2022
45526 Jun 2026
4546 Mar 2026
47417 Mar 2023
48525 Aug 2025
49227 Mar 2024
50410 Jul 2026
52321 Aug 2026
5313 Nov 2025
53422 Apr 2017
54426 Aug 2026
55321 Sep 2018
56411 Mar 2024
56217 Sep 2021
5736 Apr 2025
58123 Nov 2022
58223 Aug 2009
59228 Aug 2020
Sections 5 rows, 4 columns
SectionIDSectionLeaderExtraFee
1TennisMs Lang80.00
2GymnasticsMs Roth0.00
3SwimmingMr Berg40.00
4VolleyballMs Young20.00
5RunningMr Kaya0.00

This exercise is part of Premium.

Premium unlocks every exercise in every lesson, unlimited practice with fresh tasks and the final test with certificate.

See Premium Already Premium? Log in

The first exercise in this lesson is free.

The lesson on subqueries explains correlated subqueries.

Common mistakes

Less than instead of less than or equal

<17 instead of <=17 makes everyone who turns exactly 17 in 2027 an adult. With age limits, it pays to work through the limit with an example.

Inner join over the sections

If you join members to sections with an INNER JOIN, social members without a section drop out completely. They still pay their base fee.

In real Access

  • A family discount works the same way: a subquery counts members at the same address.
  • An append query turns the dues query into the dues rows for the new year; the level 6 project of the main course does that with VBA.
  • The fee rules belong in tables (fee groups, extra fees), not in formulas. When an amount changes, you change one row instead of a query.

How to check your result

  • Task 1: 56 active members, sorted by last name.
  • Task 2: 56 rows; member 1 pays 100.00, member 2, a junior, 60.00, member 3 200.00.

Next: case 4, Unpaid dues

Unpaid 2026 dues by reminder level and the reminder list as a report.

Go to case 4

Back to the course overview.

Write to us

Choose language

Select your preferred language