-
princess5510Asked on March 13, 2021 at 3:55 AM
Here is a link to my timesheet form that i was asked to create for my college.
https://www.jotform.com/build/210670770585459
Please clone it.
According to the form when students enter their clock in and clock out.
The time should be calculated below in the total hours column.
I have done the epoch calculations and i have done all the steps for the time calculation procedures.
However there still seems to be error.
When i enter clock in clock out and fill all session details for the first row it doesnt calculate for day 1?
It expects to fill the entire table for it to calculate each day's time calculation.
Can anybody help?
Please
-
Basil JotForm SupportReplied on March 13, 2021 at 3:07 PM
Hi,
I have cloned the form and the calculation works as long as you enter the date for the day you are filling.
Although, It seems there is an issue with the calculations equation.
Could you explain how the equation is supposed to work?
Please let us know if you require any further assistance.
-
princess5510Replied on March 15, 2021 at 1:47 AM
Yes. Even when i fill the date text field, sometimes it doesnt work??
In the screenshots you posted, the day 2 hours are being shown as -9??
which is completely wrong??
i have used the same conditions for day 1 and day 2. then what is the issue?
- Basically there are 9 conditions for each day to calculate the hours which should be shown in the text fields below the session table and also the results table at the very bottom.
- I have not produced the conditions i have only cloned it from another form.
- Please ask an expert to help.
-
Bojan Support Team LeadReplied on March 15, 2021 at 8:04 AM
Greetings.
Have you updated your form? I have tested few fields, and the calculations are correct:
These are the results:
Currently, you have conditions enabled only for these 3 fields. The results are showing as fractions (for the second day, 1.25*60 is 75 minutes, which is 1:15 when converted to hours).
If you need to get hours and minutes, you will need to add additional 3 calculation fields. The first two will be used to calculate hours and minutes, and the final one will combine those two.
To calculate the hours, you need to use the floor function on the Day 1 field (please note that I have renamed Day 1 Hours to Day 1 Total):
To calculate the minutes, you first need to multiply the total by 60, to get the selected time in minutes. Then, you need to subscript that from the result of the multiplication of total hours and 60. This will only give the selected number of hours. The difference in the selected minutes:
The final field will simply join these two together, so they are easier to read:
I have added these on the cloned form, you can test it here:
https://form.jotform.com/210733092392957You will need to do this for every field you have, I have only done it for day one. You can also hide helper fields by right-clicking on them, however, I didn't so you can see the results.
So, if someone enters this:
The final result will be:
Let us know if this solution works for you.