I am trying to subtract Text11 from text 11.1 and total it in Text11.2, I have tried different Java and FromCals. PLEASE HELP!!!
Also is there a way to add a button that is linked to the pencil tool on a form?
Solved! Go to Solution.
Views
Replies
Total Likes
Hmmm. Try removing the formatted value option in the Time2Num functions.
var Interval = Time2Num(StopTask) - Time2Num(StartTask)
Steve
Views
Replies
Total Likes
Can you post the form?
I uploaded the form. So you know whick Items I am talking about I circled them. Let me know what you come up with. Also is there a way to add documents to this? Everytime I try to do anything to it I get the error about it being an xml form.
Thanks
Views
Replies
Total Likes
1) Calculating total mileage. I would avoid using form field names that include a period (.). The parser gets confused. I renamed the fields in the attached.
2) Calculating elapsed time. I am not sure what unit of elapsed time you are trying to calculate given you have the enter events on the StartTask and EndTask set to initialize and format the current time to the second. As a result, I added a calculate script on the TotalTask to generate the elapsed time in seconds. I included the commented calculations for minutes and seconds as well.
// topmostSubform.Page1.TotalTask::calculate - (FormCalc, client)
if (HasValue(StartTask) and HasValue(StopTask)) then
var Interval = Time2Num(StopTask.formattedValue, "HH:MM:SS A") - Time2Num(StartTask.formattedValue, "HH:MM:SS A")
// elapsed time in seconds
$.rawValue = Interval/1000
// elapsed time in minutes
// $.rawValue = Interval/(1000 * 60)
// elapsed time in hours
// $.rawValue = Interval/(1000 * 60 * 60)
endif
Views
Replies
Total Likes
Thank you for the helpful hints, and the coding. I knew that the Mileage would be easy... As far as the time goes it did not work, striaght from the edited document, I added the times in both locations, and was not able to get a number calculated, is there a key stroke or something that I am missing?
Views
Replies
Total Likes
Hmmm. Try removing the formatted value option in the Time2Num functions.
var Interval = Time2Num(StopTask) - Time2Num(StartTask)
Steve
Views
Replies
Total Likes
PERFECT!!!!!! Oh this is sucfh a life saver!!!! Thank you for all of your help.
Views
Replies
Total Likes
Ok, I have one more question. I got a request to have the Total Time to be rounded to the nearest 1/4 hour. I have tried to get that information, but no luck, do you have any ideas?
Views
Replies
Total Likes
Views
Likes
Replies