Hi,
I am developing a time sheet app and having problem managing a time balance.
I have one list called ‘staff profile’ and another one to record staff shifts.
When a user records a shift, I retrieve the current ‘Time Balance’ from a column called ‘Time Balance’.
I then add any positive or negative time to that balance.
The column ‘Time Balance’ column is a number column and reflects a balance of time in minutes.
However, if a staff member has performed less ours than their rostered shift (booked off early) this produces a negative time.
Problem 1#
I can only display this negative time in minutes. If I try and convert to hh:mm format, if the time to be deducted from the balance is under one hour (for example 00:30, this does not appear as -00:30.
Problem 2#
I can patch the time balance column ok just by using minutes. However, when I try and convert this back to hh:mm to display in app it is wrong if negative value…
for example:
‘Time Balance’ column: -64
displayed in app as: -1 hr 56 mins
heres the code:
"Time Balance: " & With(
{
_value: LookUp(
'Staff Profile',
Employee.Email = User().Email
).'Time Balance',
_num60: 60
},
Concatenate(
Text(
RoundDown(
(_value / _num60),
0
)
),
" hours ",
Text(
Mod(
_value,
_num60
)
),
" minutes "
)
)
Any help or suggestions appreciated. Perhaps a better way?!