문제

I have two editable fields (Time1 and Time2), both in calendar/time type, 24hr format. Both are showing the time for example, 20:15, and I also have a computed for display field that will show the difference between two fields.

I've tried difference := (Time1 - Time2), but didn't work.

Any other way to get the difference between the two?

도움이 되었습니까?

해결책

Formula in a computed field:

_diff := Time1 - Time2;
@If( @IsError( _diff ); 0; _diff )

If the field is of type date time, then you get the difference in hours/minutes If the field is of type number, then you get the difference in seconds.

Don't forget the @IsError, otherwise your form will not open unless you have valid default values for Time1 and Time2

다른 팁

The formula in computed for display would be simply written as:

Time1 - Time2

Another thing to check is that you would have hit refresh (hit F5 or Ctrl+F5 depending on which version of Lotus Notes you have) to compute the value in computed field once Time1 and Time2 are filled.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top