Skip to main content
Contributor ⭐️
May 14, 2019 12:30 PM UTC
Question

Converting days into months using rule engine.

Hi,

How we can convert no. of days into months in gainsight rule engine. I want no. of months between two dates. I can get no. of days using datediff function but how to get no. of months from it.

Thanks

Amit

3 replies

dan_ahrens
Expert ⭐️⭐️⭐️
May 14, 2019 12:31 PM UTC
Hi Amit, would simply dividing the number of days by 30 be sufficient for your use case?

Translate
VP of Customer Success at Forcepoint
amitmehtaAuthor
Contributor ⭐️
May 14, 2019 12:34 PM UTC
Hi Dan,

It will give correct result in case value < 30 ?

Translate
dan_ahrens
Expert ⭐️⭐️⭐️
May 14, 2019 5:04 PM UTC
Well this depends on the level of precision that you need.

In most cases, counting the number of months between two dates can be derived by dividing the number of days by 30. In the cases where the number of days is less than 30, do you want that to count as a month or not as a month?

Translate
VP of Customer Success at Forcepoint