You seem to be confusing data of type time with data of type timestamp.
Timestamps record a date and a time where fields of type time record just time.
What result type did you specify for your calculation?
The calculation is set to display as a time. This was happening as well before I changed it to get as a Time instead of a Timestamp.
Under one minute the calculation works perfectly...
There must be something wrong with your syntax. GetAsTime ( "8:23:12 PM" ) - GetAsTime ( "7:32:52 PM" ) results in 0:50:20. Perhaps you should post your actual calculation.
Yes, I get 0:50:20 as well. Let's see your calculation(s).
The attached does not use Get(CurrentTimeStamp), Get(CurrentTime), or any relationships. Just 3 timestamp fields (no creation or modification auto entry) and 2 fields that show elapsed times. Just a sample––it may or may not fit your purpose.
TimestampSample.fmp12.zip 68.4 K
Well, that seems to be working as expected. What's the problem?
1 of 1 people found this helpful
If you subtract the the value of one field of type time from another field of type time, you get elapsed time in seconds. If you do the same with two timestamp fields, you also get elapsed time in seconds but now get a correct result even if midnight falls between the two values.
But result type is specified when you use manage database to define the calculation field. It's not the format you select in the inspector.
You can select a result type of number or time depending on what you need. (As an example you can divide the difference by 3600 and select a number result type to get a decimal value showing the elapsed time in hours or select a time type to get a value in hours:minutes:seconds. )
Here's what i've got going on in my calculations:
4 buttons run the script that follows to input a timestamp as a time into each of the 4 fields -
Set Field [Timestamp Field;
GetAsTime ( Get ( CurrentTimestamp ) ) ]
Each Calculation is as follows continuing through the number of timestamps (3 - 2, 4 - 3, etc.). The final fields showing the elapsed times are set as a Calculation field to display in time format -
If (IsEmpty (ActOneEnd) ; "" ; SecondTimestamp Field - FirstTimestamp Field)
That makes no sense.
Why enter time without a date into a timestamp field?
Why use Getastime ( Get ( CurrentTimestamp ) )
instead of just
Get ( CurrentTime )