Seems like this should be an easy one. I have two dates [EventDate] and [EndDate] that I need subtracted for hours worked. These hours could go from 11pm to 3am the next day.
For reporting purposes in PowerApps charts and total month/year, I am looking for a final result as a number field.
I can get the numbers I am looking for as a calculated field within a SharePoint list, but the calculated fields as a number format do not seem to work with the reporting I am trying to accomplish in with other calculations for reporting.
My first step was to convert both start and end using this. formatdatetime(triggerBody()?[EventDate],'HH:mm')
With those results, I thought I could just use an expression to subtract the two with an output as a number format and not a text.
This link is great for SharePoint, but I am looking for a step further when using Flow and PowerApps. http://thuansoldier.net/?p=3823
So I think I just need a start date - end date = total as a number format.
Microsoft flow uses workflow definition language to work with parameters. But it seems that currently there is no function can be used to count hours between two days.
The doc on workflow definition language for your reference:
Please consider submitting a request at Flow ideas Forum at here, I will help collect and report it on my side:
Have you tried translating the dates to be compared into ticks? The general procedure for comparing dates is described in the following thread:
Once you get the difference in ticks you shall convert it into hours. Given a timestamp in string format, the ticks() expression returns the number of ticks (100 nanosecond intervals) since 1st January, 1601. By using ticks, we can compare two different timestamp values.
Hope this helps