1) In Inspector you choice how to show your field depending on field type. For Time fields you can choose hh:mm:ss or any other version of hh/mm/ss that you prefer.
2) Create a new calculated field of type Numeric. Set calcuation to:
EndTime - StartTime
Your result will be in seconds between those times. If you like to see it in minutes
(EndTime - StartTime) / 60
(EndTime - StartTime) / 3600
Thanks for answer Johan
1. this data formating would not controll what the user is wrinting in the field. With edit box as control style it would allow characters and letters as well. Is the only solution to make a fixed drop-down list only of every hours of the day?
2. This seem to work when I have the right format in 1. I also would need a CALCULATEDAYS fields in this solution, that calculates from a STARTDATE to an ENDDATE, how could I do this ?
1) Whenever you need to make a calculation out of Date/Time/Numeric you need to know your data is in the correct order. For this you can not let user enter anything else then time into the two fields (StartTime and EndTime) that you have. You can set this in field validation so that you always know you data is correctly entered into your fields.
2) For calculation days create a new calculated field and enter
EndDate - StartDate and you will get number of days between start- and enddate
Nice Johan, thanks!
1. Okey. but I regonized that if the i select a starttime as 13.00.00 and a endtime as 03.00.00, the field would automaticly remove the first 0 so it displays the end time as 3.00.00, and then the calculated time is -10. Why is this?
2. The dropdown calender says that I input wrong date format, it uses 23.06.2016 and the format of the value should be 23/06/2016 says the error? How could change the date field to accept only the 23.06.2016 format?
1) in what other calculation engine would 3 - 13 not be -10?? Of course it becomes -10 and to be able to handle that correctly i suggest that you instead create Start Timestamp and End Timestamp. Timestamp is both date and time. Then you create a new calculation field with:
End Timestamp - Start Timestamp
the result will be in seconds so if you want that to be in minutes:
(End Timestamp - Start Timestamp ) / 60
2) Date formats all applies to what you have created your file in for format for dates. In Sweden we have yyyy-mm-dd for example.
1) You can not use calendar selector for timestamp because it needs date & time.
If you really need users to enter Date & Time create a calculated TimeStamp for End and Start
Date & " " & Time fore each (StartDate & StartTime and EndDate & EndTime)
Then use the two new calculated fields that I wrote about earlier
2) It is not what you show, it what you have to enter. You can Format what to show but not what to enter
For the start timestamp use two input fields, start date and start time. Make sure that they are correctly formatted and "forced" to only accept certain types of data. (Date, four digit year, time and so on.) Then create a calculation field for start timestamp, use the "timstamp()" funktion for the calculation and make sure that the result is "timestamp". (Check the lower left corner of the calculation dialog.)
Do the same for end timestamp.
Calculate any differences using the two calculated timstamp fields.
With best regards Magnus Fransson.
1. Okey thanks, I would try this
2. So its no way to insert the right format in the date field from a calender dropdown list? Without manually write 23/06/2016 in the field? Can I change the . to / seperator in the validator of the field or something liek that then?
That worries me a bit. The norwegian standard is 23.06.2016 and that what the drop down calender is putting in the field, but the field validator is not able to set to be the norwegian standard? If so then that means that we need to change all the users workstations systemdate format.. :/