Calculations from inputs involving time.

B

Bryan Potter

I am looking to calculate the total number of hours between two different
times. ie. 12:00 pm - 3:00pm = 3 hours.

I have input fields for the two different times, but when i try to set up a
calculation for computing the difference between the two inputs i get a 'NaN'
output. Any suggestions?
 
F

Franck Dauché

Hi Bryan,

Look at the thread 4 posts below yours untitled: "Adding Time????"

Regards,

Franck Dauché
 
B

Bryan Potter

Hi Frank,

Unfortunately, this still doesn't answer the question. Simply substracting
the two times (formatted as a 24 hour clock) gives me the result of 'NaN.'
Any other suggestions?
 
B

Bryan Potter

Hi Franck,

The values are being formatted and stored as "time" in a text box control.

Bryan
 
F

Franck Dauché

Try string for the field that stores the Time diff. Also, that third box
should be read-only so that nobody can type in it.

Franck
 
G

Geoff May

Hi Frank I am trying to do something similar to Bryan Potter, Subtarct Finish
time from start time to give hours worked. I have tried the simple formula
A2-A1 but get NaN in the third cell. I have also tried the larger formula in
the third cell function box and get error message, Node- Test Expected.
Any other ideas? Thanks Geoff May
 
G

Geoff May

Hi Bryan, were you able to get the result you wanted? I had the same problem
when I used A2-AI. I got NaN in the third cell. I also tried bpeltzen's
longer formula but got an error message? Thanks Geoff May
 
F

Franck Dauché

Hi Geoff,

Is your node where you are storing your result a string?

Regards,

Franck Dauché
 
G

Geoff May

Hi Frank, I am not a technical person but have had some experiience in using
InfoPath to develop some reasonably simple forms. In this case I have three
data source fields.
Start Time, Finish Time and Hours worked. Start Time and Finish Time are
formatted as time and Hours Worked is formatted as a Text string and in the
formula box I have a formula of Finish Time minus Start Time. When I preview
the form and enter times in the first two fields I get NaN in the third
field.
Thanks Geoff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top