Hi Team,
I am using custom record field for date difference function (a!customFieldDateDiff), however the problem is that this function rounds off the date to floor. eg 10.99 Days will be 10 Days.
do we have any other function which will do the job correctly ?
Thanks in Advance
Discussion posts and replies are publicly visible
Hi there,
To get a more accurate, floating-point result Instead of calculating the difference in days directly, calculate the difference in hours and then divided it by 24 to convert it back to days. Here's what it looks like:
a!customFieldDivide( a!customFieldDateDiff( startDate: 'recordType!{46be8507-bc40-4c95-8264-c1b9636a277b}AL Customer Data.fields.{fae1dc47-fb25-4dd2-ad5a-539b51898180}createdOn', endDate: now(), interval: "HOUR" ), 24 )
This approach gives you the decimal day difference, like 10.99, instead of just 10.Now you can use cieling or integer functions in interface according to your requirements.
Hope this helps!
Thanks for pointing this out. I was not aware of the "interval" parameter. Will try to keep that in my mind.