Date query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a membership table with a subdata table (one membership to many years)
containing one column for subscription paid date.
How do I filter/query who hasn't paid for this year?

Is this the best way of doing the table designs?


Thanks for any assistance
 
A Two query solution. Find all those members that do have dues paid for the
year and then use that with a find missing wizard. The SQL text would look
something like the following.

QueryA
SELECT A.MemberID
FROM DuesTable as A
WHERE A.DatePaid Between #1/1/2004# and #12/31/2004#

Query Two
SELECT B.MemberID
FROM MemberTable as B LEFT JOIN QueryA
ON B.MemberID = QueryA.MemberID
WHERE QueryA.MemberID is Null

This can be done in one query using a subquery in a couple ways.

SELECT B.MemberID
FROM MemberTable as B
WHERE B.MemberID NOT IN
(SELECT A.MemberID
FROM DuesTable as A
WHERE A.DatePaid Between #1/1/2004# and #12/31/2004#)

And yes, your table design sounds as if it the best design for what you are doing.
 
Back
Top