Skip to main content
Solved

Date differences with null values

  • November 26, 2019
  • 2 replies
  • 27 views

I need to find the number of days an agent is active. Currently, I have 3 columns “Start Date”, “End Date”, and “Days Active” and my formula in my Days Active column is:

DATETIME_DIFF({End Date},{Start Date},‘days’)

Some agents are still active and do not have an “end date” and I get an error message in the Days Active Column. How do I enhance my formula to replace null values in the End Date column with today’s date?

Best answer by Justin_Barrett

Welcome to the community, @Anabel_Hurtado! :grinning_face_with_big_eyes: Try this formula:

DATETIME_DIFF(IF({End Date}, {End Date}, TODAY()), {Start Date}, 'days')

2 replies

Justin_Barrett
Forum|alt.badge.img+21
  • Inspiring
  • Answer
  • November 26, 2019

Welcome to the community, @Anabel_Hurtado! :grinning_face_with_big_eyes: Try this formula:

DATETIME_DIFF(IF({End Date}, {End Date}, TODAY()), {Start Date}, 'days')

  • Author
  • New Participant
  • November 27, 2019

Welcome to the community, @Anabel_Hurtado! :grinning_face_with_big_eyes: Try this formula:

DATETIME_DIFF(IF({End Date}, {End Date}, TODAY()), {Start Date}, 'days')

Thank you! That worked!