Hello PowerApps Team,
I've checked posts here on how to compute for the summary of timestamps but I cannot find a scenario with a Data Table.
I put a data table in my app:
Is there a way on how I can get the total hours per day? (Start time up to End minus the breaks?)
Is this possible?
The punches comes from the clock that I put inside the app with this formula:
Text(CurrentDateTime,"[$-en-US]dddd mm/dd/yyyy hh:mm:ss")
Thank You ,
Kharina
Hello @poweractivate ,
I tried a couple of ways and I'm still not getting it. Sorry. I'm not very good with this.
I am getting an error: Invalid argument type Text. Expecting a DateTime value instead.
The formula that I am trying is this: DateDiff(First(Stamp).TimeStamp, Last(Stamp).TimeStamp [, "[$-en-US] hh:mm:ss" ] ).
If I separate the time:
And I use the formula: Last(Stamp2).Time-First(Stamp2).Time
I am getting a zero value.
Can you help me fix my formula please?
Thank You ,
Kharina
You must convert the Text values returned from the Control to DateTime values before the DateDiff function can be used to calculate the difference.
So try something like this instead:
DateTimeValue(First(Stamp).TimeStamp)
and also
DateTimeValue(Last(Stamp).TimeStamp)
Please also note, if the above does not work directly DateTimeValue, you may have to make sure it is the right format first and use more functions in different way. You can consult these following docs.microsoft.com links for more help on the appropriate functions:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-datevalue-timevalue
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-date-time
You may even have to go as far as to use the Split function not only on the string but also on the parts of the string too, reconstruct the string into one of the valid formats for DateTimeValue first using Concatenate before finally using it with DateTimeValue and ultimately DateDiff to accomplish this goal.
Check if this helps.