Skip to main content
omj2851
August 6, 2024
Question

Error while using subtractdays() function

  • August 6, 2024
  • 6 replies
  • 0 views

I am facing the issue while trying to get the below mentioned logic through subtractdays() function.

logic: we need the value i.e. current date - 74 days

used expression:  subtractdays(today(), 74)

error found:

6 replies

karumurua531442
August 6, 2024

hi [mention:67d3e8c7ee954087ae38b3a86b2789c3:e9ed411860ed4f2ba0265705b8793d05]  what is the function you are using is that a plugin function?  may your complete requirements and expected output please, currently you can directly do todate(today()-74)  gives you 74 days back date. 

omj2851
omj2851Author
August 6, 2024

Hi [mention:3510a5189ce1477eaf2e09f5858c87e9:e9ed411860ed4f2ba0265705b8793d05] 

i have below mentioned code

if(
todate(fv!item.LastApproveDate) <= today() - (
cons!PPA_USER_APPROVAL_INTERVAL + cons!PPA_USER_APPROVAL_ESCALATION_INTERVAL
),
true(),
false()
)

Where i need to replace this part of logic

today() - (cons!PPA_USER_APPROVAL_INTERVAL + cons!PPA_USER_APPROVAL_ESCALATION_INTERVAL)

with

substractdays fucntion

August 6, 2024

subtractdays() expects dateTime as its first input. But here, today() is of type date.

prasantap0900
August 6, 2024

The function "today()" returns only date not time. For the subtractDay() function, the first parameter you should pass date and time. I am attaching the snippet. Maybe it will be helpful.