cancel
Showing results for 
Search instead for 
Did you mean: 

Calculating Time worked from begin hour and end hour in a Table

Former Member
0 Kudos

Hi,

I'm trying to make a calculate event in a table row, but it doesn't work.

the calculation seems to work, but displaying the result in the last field of the row doesn't give the expected result.

the message Box gives the right value, but displaying the calculated in row doesn't work

xfa.host.messageBox(concat("n5 time resultaat naar $ ", $), "Debugging",3)

What is missing?

the code is the following.

var n3 = Time2Num(data.#subform[0].TRAVEL.Travel.#subform[1].Table3.Row1.end_time[*].formattedValue, "HH:MM:SS" )

var n4 = Time2Num(data.#subform[0].TRAVEL.Travel.#subform[1].Table3.Row1.start_time[*].formattedValue, "HH:MM:SS" )

var n5 = (n3 - n4) / 3600

$ = n5

xfa.host.messageBox(concat("n5 time resultaat n5 ", n5), "Debugging",3)

xfa.host.messageBox(concat("n5 time resultaat naar $ ", $), "Debugging",3)

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

where's your code that actually assigns the value to your row.field?

If you placed this code in your Calculate event on the Total Field (or whatever), you still need to ** assign** the total to the field.

Edited by: robert phelan on Mar 24, 2009 5:09 PM

Edited by: robert phelan on Mar 24, 2009 5:09 PM

Answers (1)

Answers (1)

bryan_cain
Contributor
0 Kudos

Are you able to set $ to a hard coded value in that script?

Former Member
0 Kudos

the assigning must be the last line in the code, that was the problem