This topic is locked

Using fields to calculate values for another field

4/29/2005 2:59:00 PM
ASPRunnerPro General questions
S
Skynet author

Hi:
I am using several tables that use several fields to calculate a value of another field. For example:
Field D = Field A - Field B - Field C
where i need put this formula to calculate value for field D and how can I tell to the web page that perform formula after update field C?
Thanks for your help.

Sergey Kornilov admin 5/4/2005

Hi,
you can use calculations in SQL query for this purpose:

select

...,

FieldA - FieldB - FieldC as FieldD

from table

S
Skynet author 5/4/2005

Thanks! this solution work great including more complicated calculations.

S
Skynet author 5/5/2005

The solution that you give me works nice, but don't update the database with the value calculated for Field D. How I can to update Field D in database.
Another problem that I found is if I want to calculate the TOTALS for Field D sometimes TOTALS = 0. Where ASPRunnerPro calculate TOTALS?
Thanks!
P.D. I will sent my complete proyect in ZIP format from e-mail simon@csaca.com to check problem.