time calculation

Hi Team,

I want to calculate time in hours between two date time like on 

18th 8am to 18th 10am :- 2 hours

18th 12pm to 18th 8pm :- 8 hours 

total :- 10 hours

Can anyone please help calworkhours is not working properly.

  Discussion posts and replies are publicly visible

Parents
  • Not very helpful but I think calworkhours() is literally calculating a "between" value which means that one of the boundaries (probably the end_datetime) is not being included. An example: between 8am and 10am is actually 1hour and 59 minutes and 59 seconds. I can see that if I do this:

    calworkhours(
      fn!todatetime("18/07/2022 8:00 am"),
      fn!todatetime("18/07/2022 10:01 am"),
    )

    then I get this;

Reply
  • Not very helpful but I think calworkhours() is literally calculating a "between" value which means that one of the boundaries (probably the end_datetime) is not being included. An example: between 8am and 10am is actually 1hour and 59 minutes and 59 seconds. I can see that if I do this:

    calworkhours(
      fn!todatetime("18/07/2022 8:00 am"),
      fn!todatetime("18/07/2022 10:01 am"),
    )

    then I get this;

Children
No Data