find days between two dates using daysbetween()

0
I’m trying to find number of days between two dates but ending up with error, Details below and please help me in resolving this issue.   Microflow: Change decimal variable with below action value: daysBetween($Entity/Expiry_Date,$Entity/Today)   $Entity/Expiry_Date => Input from user (Format:  Date and Time) $Entity/Today => picked today using [%BeginOfCurrentDay%]   Error message: "Caused by: com.mendix.languages.expressions.ExpressionException: Incorrect arguments for function daysBetween: null"
asked
5 answers
1

Can you debug the microflow, maybe one of the two attributes is empty, furthermore you can try first to make this action in a variable, so create a variable called daysBetween and after that set it on the entity. 

answered
2

hi Selvakumar,

In daysbetween() function you should pass two datetime as argument.

 

Example:  daysBetween(dateTime,dateTime)

 

$Entity/Today => picked today using [%BeginOfCurrentDay%], instead of this given date and Time as like

$Entity/Expiry_Date => Input from user (Format:  Date and Time) 

hope it will help you.

 

answered
0

Hi Selvakumar,

 

You can create below microflow & check

 

Date1 = Input from user

Date 2 = [%BeginOfCurrentDay%]

Days = daysBetween($Date1,$Date2)

 

 

answered
0

hi Selvakumar,

In daysbetween() function you should pass two datetime as argument.

 

Example:  daysBetween(dateTime,dateTime)

 

$Entity/Today => picked today using [%BeginOfCurrentDay%], instead of this given date and Time as like

$Entity/Expiry_Date => Input from user (Format:  Date and Time) 

hope it will help you.

 

answered
0

hi Selvakumar,

In daysbetween() function you should pass two datetime as argument.

 

Example:  daysBetween(dateTime,dateTime)

 

$Entity/Today => picked today using [%BeginOfCurrentDay%], instead of this given date and Time as like

$Entity/Expiry_Date => Input from user (Format:  Date and Time) 

hope it will help you.

 

answered