Calculation Combining Fields, Not Adding

5 pts.
Tags:
Calculating fields
Database programming
Hello, This should be really simple. I have 3 fields that calculate correctly on a form and insert the calcuation into a table. (I know, NEVER store a calcuated value, but I have a reason for doing it.) Now I'm trying to add those 3 fields and am getting an incorrect sum. Here is my string: Me.Total_Man_Hours_Text = Nz([Total_Man_Hours_Calc_Field_1], 0) + Nz([Total_Man_Hours_Calc_Field_2], 0) + Nz([Total_Man_Hours_Calc_Field_3], 0) When field "1" equals 11, field "2" equals 0, and field "3" equals 0, I am getting a sum of 1100. So it's combining the 11, 0, and 0. Anyone?

Answer Wiki

Thanks. We'll let you know when a new response is added.

it is taking them as text rather than taking them as numeric. so instead of governing a mathematical addition of 11+0+0 = 11, it is adding it as text – ’11′ + ’0+ ’0′ = 1100

you have to convert these fields to numeric first. or convert text to number in your formula while addition.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following