Calculations and Query Criteria

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

Guest

I use calculations in queries constantly for my reports and forms. When I use multiple calculations in a query and I place criteria for that calculation, I get a paramter pop up for my first calculation. How can I avoid this?
 
I use calculations in queries constantly for my reports and forms. When I use multiple calculations in a query and I place criteria for that calculation, I get a paramter pop up for my first calculation. How can I avoid this?

Please post the SQL view of your query. I don't usually see this
happening!
 
What is [Net Value]? I don't see it defined anywher else. Also, if [Net Value] exists somewhere, why not just use it and not name it as an expression [Less Net Value]?

I may be wrong, but I don't know what fields are in the tables or queries.
 
Thanks for picking up on that redundancy, I picked up on it too and corrected it. . . [Less Net Value] is redundantly naming [net value] in the select statement, I removed it, adn kept [net value] as [net value]...[net value] is the first calculation in the query, I defined a field in the query and named it net value with the calculation in it. Later on in the query I use this calculation in another calculation, and I get the pop up.
 
Okay, my query works now because I combined all calculations into one at the end to retrieve my results based off of my criteria. Can Access do this without making one gigantic calculation at the end where I base my criteria?
 
Can Access do this without making one gigantic calculation at the end where I base my criteria?

Only occasionally. In my experience, you usually CANNOT reuse a
calculated expression in a later expression. You can sometimes get
away with it but I don't know what the criteria are for whether you
can or can't; I'll typically do all calculated expressions directly
from table fields, rather than building up intermediate calculated
fields.
 
Okay. The reason why I have the multiple calculations is because users need to see those values on a form, all broken down. But thanks for the help all who posted.
 
Okay. The reason why I have the multiple calculations is because users need to see those values on a form, all broken down. But thanks for the help all who posted.

One possibility would be to do the first-level calculations in the
Query, and then use those expressions for further calculations in the
Control Source of textboxes on the form.
 
Back
Top