Expression Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • J Hall
    New Member
    • Aug 2010
    • 6

    Expression Help

    I have a query set up with a list of records with check box fields, Text boxes and one text field with numbers.

    I used this expression to get the sum total of [Text box with numbers] per total records by counting [Text Box A]

    =Sum([Text Box with numbers])/Count([Text Box A])

    80/21=3.81



    Now I want the total of [Text box with numbers] per records with [Check Box A] checked.

    24/6=4

    I've tried the expression below and get 3.80 and not 4.

    =IIf([Check Box A]=-1,(Sum([Text box with numbers]))/(Count([Text Box A])))

    Hope this makes sense.
    Any Help would be great
    Thanks,
    J
  • beacon
    Contributor
    • Aug 2007
    • 579

    #2
    Hi J,

    If the following is equal to 3.81
    =Sum([Text Box with numbers])/Count([Text Box A])

    80/21=3.81
    then how would this:
    =IIf([Check Box A]=-1,(Sum([Text box with numbers]))/(Count([Text Box A])))
    be any different from the first expression when the first expression is included in the second expression, the only difference being the conditional you tacked onto the beginning?

    What are you trying to accomplish with this query? It's difficult to make sense of what you're doing when you use [Text box with numbers] as the field name without a slightly more detailed explanation of the problem.

    I'm going to go out on a limb, since I don't know what the purpose of the query is, and I'm going to say that you would probably be best served stopping this query after you return the results in the first expression. Then, you can use that query in another query to compile the results.

    Hope this helps...if not, let me know.

    beacon

    Comment

    Working...