Calculations in a query

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

Guest

I need to use different formulas in a calculation depending on the data. How
can I make a query choose between 2 different formulas? If anyone can help me
please respond as fast as possible because I have a deadline for the database
tomorrow, Thursday 6.
 
Without some idea of the query (e.g., the SQL statement), or how you will
use the query results, it'll be tough guessing...

Have you considered creating two fields in your query, doing both
calculations, then "choosing" which one in a subsequent query (or in a
report? but you didn't say how you'd be using ...)?

Just one person's opinion

Jeff Boyce
<Access MVP>
 
What I need is a database for quality control.. I have made some fields
whitch calculate the different specifications, but with one of the products
the calculation is different. If I make the calculations like you suggest,
with 2 fields in the query, is it then possible to make a macro or something
that show the right field in a formular?

"Jeff Boyce" skrev:
 
Have a look at the IFF statement. In a new column in the query you could do

=IFF([MyData]="ChooseFormula1", [a] * , [c] * [d])

where a,b,c, and d are fields in the query and "[MyData]="ChooseFormula1""
is how you determine what formula to use
 
Back
Top