Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate a Formula in a Query

Status
Not open for further replies.

orna

Programmer
Apr 2, 2002
314
IL
Hi

I have a formula in a table's field that can look like:
[A]*9.5
or
2.5*[A]-1.5*
where [A] and are also the table's fields.
and need to calculate the result to another field within a query.

is it possible?

TIA
 
When you are at the design view of the query right click on a new field and choose "build". You can create whatever available functions there. Remember to add a name to field like Total: after creating it will loek like below
[tt]Total:[Rate]*[Quantity][/tt]

Zameer Abdulla
Jack of Visual Basic Programming, Master in Dining & Sleeping
Visit Me
 
Thanks Zameer!
The problem is that evry record has a diferent formula.
 
So Why & How do you calculate the [a] & in the table?(as it is opposed to normal RDBMS theory) Why don't all do it in a query? And you will be having result field and calculate that field to a new calculated field.
hope this helps

Zameer Abdulla
Jack of Visual Basic Programming, Master in Dining & Sleeping
Visit Me
 
[A] and [B} are numeric value that changes from time to time.
I do calculate the Result field only.
Result = [A]*9.5
or
Result = 2.5*[A]-1.5*
the numbers "9.5" , "2.5" .... are constants.
I hope i explained it better.
 
If you can calculate the first value then you can the second one as well in a new filed.
If this is not the answer Sorry, I can't follow it. Can you please elaborate it. Or some one who can understand it may able to help you

Zameer Abdulla
Jack of Visual Basic Programming, Master in Dining & Sleeping
Visit Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top