Basing a calculated field on another calculated field (1 Viewer)

duckster

Registered User.
Local time
Yesterday, 23:50
Joined
Jul 17, 2004
Messages
78
My query contains two calculated fields [TaxSavings1] and [TaxSavings2], which are based on some currency and number-type fields in one of my underlying tables.

I just created another field in my query which looks like: [TaxSavings1]+[TaxSavings2]. Instead of adding the two fields, it actually lumps the two numbers together. For example, if [TaxSavings1] =135 and [TaxSavings2]=30.25, it will give me: 13530.25. I need it just to simply add, i.e. answer of 165.25.

Does anyone know how to correct this? Thanks in advance.

:confused:
 

EMP

Registered User.
Local time
Today, 07:50
Joined
May 10, 2003
Messages
574
It sounds like the calculated fields [TaxSavings1] and [TaxSavings2] returned two text strings rather than two numbers.

A quick fix would be to use the Val() function to convert them into two numbers:
Val([TaxSavings1])+Val([TaxSavings2])

A more efficient fix would be to look into the original expressions for [TaxSavings1] and [TaxSavings2] and make them return two numbers instead of two text strings.

^
 

Users who are viewing this thread

Top Bottom