Calculating DATEDIFF in HOURS | Community
Skip to main content
February 25, 2019
Question

Calculating DATEDIFF in HOURS

  • February 25, 2019
  • 5 replies
  • 983 views
This must be extremely simple, but I cannot get my expression to work. I have created a calculated expression. I am open to covering this to text mode in reporting, but I just want to get it to work. In Workfront, I have been trying to convert DATEDIFF into total hours. Now, my date fields are custom date fields, they are tied to issues, but my business sponsor wants to see values for these dates in the follow formats: Difference in total hours between date 1 and date 2. Different in total business hours between date 1 and date 2. Any advice on how to convert my formula from a simple DATEDIFF(Date2, Date1) to display the total hours between these date fields? Jaclyn Reiter, PMP, SA Project Manager, Strategic Initiatives Equifax, Inc. St. Louis, MO 314-684-2693
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

5 replies

February 25, 2019
Would it be easier to change over and start using WORKMINUTESDIFF instead? As in WORKMINUTESDIFF (Date 2, Date 1)/60 -skye
JaclynRe1Author
February 25, 2019
That's were I was heading too. I can get this to work. My only area of concern is that this returns the number of scheduled minutes between the dates according to the default schedule, and the teams tracking issues here have schedules that are all over the place. Some work between the hours of 2am and 12am while others are more 8 to 5, but the point is that the business hours for these teams just aren't consistent. So, my sponsor is asking for 24 hours. Do you think I should manipulate the default schedule and change it from 8am to 5pm to 24 hours? I don't think it would be a problem because we really aren't using the default schedule for anything. Jaclyn Reiter, PMP, SA Project Manager, Strategic Initiatives Equifax, Inc. St. Louis, MO 314-684-2693
February 25, 2019
well, I see why you're not using workminutesdiff, if everyone is on a different workday. I can't speak to changing your default schedule (probably you should try that out in the sandbox). Maybe can you show your other datediff equation to see what's going on? A weekdaydiff(date2,date1)*24 worked in my report in a calculated column--is this what you're trying on your side? -skye
JaclynRe1Author
February 27, 2019
Thank you, Skye. You gave me an idea that solved my problem. I just did DATEDIFF(date2, date1)*24 and that is working correctly. Super simple, but I just couldn't get myself all the way to the solution. I really appreciate your help. If it weren't for you, I wouldn't have figured it out. Thanks, maybe I'll see you at LEAP. Jaclyn Jaclyn Reiter, PMP, SA Project Manager, Strategic Initiatives Equifax, Inc. St. Louis, MO 314-684-2693
February 27, 2019
I will definitely be there! So glad your problem was resolved. :) -skye