Skip to main content
Solved

Check IF Record Occurred Within Last 30 Days

  • August 17, 2020
  • 5 replies
  • 48 views

Hi,

We have a base that, amongst other things, generates requests and records when the request is completed. To provide feedback on performance, we measure the number of working days it took to complete the task using:

WORKDAY_DIFF({Request Date},{Time Processed})

We can then use a Summary Block to give an average “headline" of the number of working days taken to complete.

We then have then used the following to report the average during the previous month:

IF(DATETIME_FORMAT({Request Date}, “YYYY-MM”) = DATETIME_FORMAT(DATEADD(NOW(), -1, “month”), “YYYY-MM”),WORKDAY_DIFF({Request Date},{Time Processed}),BLANK())

So here, during Aug, it will give the average for July.

How can we have this a little more “live” by reporting the number of days taken to complete over the past 30 days?

Best answer by Kamille_Parks11

Use DATETIME_DIFF() to get the amount of time between two dates.

IF(DATETIME_DIFF(NOW(), {Request Date}, 'days') <= 30, WORKDAY_DIFF({Request Date}, {Time Processed}), BLANK())

5 replies

Kamille_Parks11
Forum|alt.badge.img+27

Use DATETIME_DIFF() to get the amount of time between two dates.

IF(DATETIME_DIFF(NOW(), {Request Date}, 'days') <= 30, WORKDAY_DIFF({Request Date}, {Time Processed}), BLANK())


  • Author
  • Known Participant
  • August 18, 2020

Perfect @Kamille_Parks - exactly what I needed. Thanks for your help with this.


Forum|alt.badge.img+4
  • Inspiring
  • August 18, 2020

Use DATETIME_DIFF() to get the amount of time between two dates.

IF(DATETIME_DIFF(NOW(), {Request Date}, 'days') <= 30, WORKDAY_DIFF({Request Date}, {Time Processed}), BLANK())


any idea how to figure all days not just working days (7 day week instead of 5) is it just WEEK?


Forum|alt.badge.img+18

any idea how to figure all days not just working days (7 day week instead of 5) is it just WEEK?


@Rebecca_Elam
I think you can just replace the WORKDAY_DIFF part of @Kamille_Parks’s formula with DATETIME_DIFF – if I understand your question correctly.


Kamille_Parks11
Forum|alt.badge.img+27

any idea how to figure all days not just working days (7 day week instead of 5) is it just WEEK?


That same formula shows how to use DATETIME_DIFF(), which again, calculates the time between two dates.