Access count

  • Thread starter Thread starter Guest
  • Start date Start date
LoveAccess,
Because that Access doesn't calculate Counts that way in a query...

If your trying to Count the number of meals where Meal = 1, then...

MeatCount : IIF([Meal] = 1, 1, 0)

That places a 1 in any record with Meal = 1, and a 0 if not.
Now select View/Totals from the menubar, and use Count in the Total line for that
calculated field.
That will give you a count of all Meals =1.
 
Let's see....

Instead of count, you might be able to get the DCount function to work or a
subquery to count up the Meat. IIf evaluates each record and can't grab data
from the entire table readily.

The syntax of an IIf function requires three arguments. Yours doesn't say
what to do if Meal is not equal to 1.
IIf(expr, truepart, falsepart)
 

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

Back
Top