Question
F. Hoffmann-La Roche Ltd
IN
Last activity: 27 Jun 2021 23:14 EDT
Getting incorrect business day difference by using function differenceBetweenDays
Hi All,
We are facing a issue with differenceBetweenDays function. By using this function we are getting correct results for past days (Current Date and Past Date) but for future it is giving incorrect date difference( because it is considering Saturday as working day and Sunday/Monday as holiday).
@(Pega-RULES:BusinessCalendar).differenceBetweenDays( Param.CurrentDate, Param.DesiredDate , true, pxRequestor.pyCalendar)
Thanks and Regards,
Kapil Dev Gautam
@KapilDevGautam
Can you check if you are doing it correctly and in correct place
@(Pega-RULES:DateTime).DateTimeDifference("20171120T201834.985 GMT", "20171124T201834.985 GMT", "D")
Can you make the data element as a calculated field and add this expression as the formula?
Refer- https://community.pega.com/support/support-articles/formatdatetime-function-returns-incorrect-result
https://community.pega.com/support/support-articles/differencebetweendays-calculated-incorrectly
https://community.pega.com/support/support-articles/businesscalendardifferencebetweendays-not-working-expected