[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
Solved

# Unexpected results when adding 2 field values with script

Posted on 2003-12-04
Medium Priority
221 Views
Hi Guys

This is just weird

What the following is doing is putting two values together e.g. 3 +3 =33 not 6 as expected
This just started happening, this was in an existing working script

doc.totalAH_1 = doc.CarriedOverAH_1(0) + doc.AllowanceAH_1(0) 'Calculate the used vacation  days
doc.totalAH_2 = doc.CarriedOverAH_2(0) + doc.AllowanceAH_2(0)  'Calculate the remaining vacation days
0
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

LVL 24

Expert Comment

ID: 9876495
That says that the two fields are of text and being concatenated

doc.totalAH_1 = @TextToNumber(doc.CarriedOverAH_1(0)) + @TextToNumber(doc.AllowanceAH_1(0)) 'Calculate the used vacation  days
doc.totalAH_2 = @TextToNumber(doc.CarriedOverAH_2(0)) + @TextToNumber(doc.AllowanceAH_2(0))  'Calculate the remaining vacation days

~Hemanth
0

Author Comment

ID: 9876502
This in script not formula
0

LVL 24

Accepted Solution

HemanthaKumar earned 1200 total points
ID: 9876561
oh I totally missed to see doc.

doc.totalAH_1 = cint(doc.CarriedOverAH_1(0)) + cint(doc.AllowanceAH_1(0)) 'Calculate the used vacation  days
doc.totalAH_2 = cint(doc.CarriedOverAH_2(0)) + cint(doc.AllowanceAH_2(0))  'Calculate the remaining vacation days
0

LVL 19

Expert Comment

ID: 9880940
easy points?
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
###### Suggested Courses
Course of the Month12 days, 13 hours left to enroll