Expression using multiple conditions

G

Guest

I'm stumped and I'm hoping someone can help me. I have to use a
multi-conditional expression within a query to compare records in two
different tables that are not unique and return a result:

I have to compare two fields in Table1 (CampID & SiteID) to two similar
fields in Table2 and if both values match return a value for a third field in
Table1 (EstimatedAttendants). So essentially I need something that does the
following:

If Table1!CampID=Table2!CampID
AND If Table 1!SiteID=Table2!SiteID
then show the result of (Table1!EstimatedYouth+Table1!EstimatedAdults)

I don't know if this is possible, but I appreciate any help I can get.
 
J

JohnFol

Put both tables in a query. drag the CampID from table1 to table2. Do the
same with SiteID. This will give you all rows where the following condition
is true

"If Table1!CampID=Table2!CampID AND If Table 1!SiteID=Table2!SiteID"

Now enter the expression in the first column, ie

=Table1.EstimatedYouth + Table1.EstimatedAdults
 
G

Guest

When I input this expression I'm getting the following error message:
The syntax of the subquery in this expression is incorrect. Check the
subquery's syntax and enclose the subquery in parentheses.

I'm sorry to be a bother, but I copied it exactly as you posted (gotta love
cut and paste) ... am I forgetting something?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top