Req: Count of Two Columns

  • Thread starter Thread starter kenneth_lad
  • Start date Start date
K

kenneth_lad

hi all,

can anyone tell me how to create a query that counts two columns in across
two tables that i have?

i know how to count individual columns but i seem to have a problem
counting the total of both columns.

the information is to help me with an upcoming event that i am staging for
out members. one table lists all of our members and the column that i want
the count has a "Yes" in it if the member is attending.

in a second table i have a member guest join which lists the names of the
guests each member is bringing.

therefore i want to be able to count the total number of people attending
(members and their guests).

thanks to anyone who can help
 
Try this:

=Abs(DSum("IsAttending", "MemberTable") + DCount("*", "GuestTable")

Internally, Access uses -1 for Yes and 0 for No. Therefore summing your
yes/no field gives a count of the number of yeses (but negative).

DCount() gives the count of records. Counting everything (the "*") is the
fastest result.
 
Try this:

=Abs(DSum("IsAttending", "MemberTable") + DCount("*", "GuestTable")

Internally, Access uses -1 for Yes and 0 for No. Therefore summing your
yes/no field gives a count of the number of yeses (but negative).

DCount() gives the count of records. Counting everything (the "*") is the
fastest result.

Thank you!
 
Back
Top