Skip to main content

I am using operator Not Equals to compare two calendar input fields,  but it seems doesn't work. The result is always not equal, even two calendar have the same value, e.g 2014/3/27. How can I fix it?

14748i48BC65E4487F8FC3.jpg

As a test I would suggest setting up the rule when the calendar control is changed it passes a value to the data label for both the startday and endday.

 

This will see what the actual value of the control is, since the calendar controls are datetime type.

 


It is probably including the time part of the date.

 

So as the above post states, output the values of the date fields. If it includes the time then you will have to strip out the time portion of the date or format both dates to contain the same time e.g. 00:00:00.


Hi Junesh


 


I found that when you set the advanced condition to evaluate "not equal" then it always evaluates to true, as you said.


I reproduced this issue that you are facing and played around a bit, I found that if you evaluate the condition with "Equals" instead of "Not Equals" then the outcome is as expected.



Steps Taken (I did it in a Item View):


12458iBEA0922EDEA73210.png


 


1. Select StartDate Text Box > Add a rule with a advanced condition of "EndDate Equals StartDate".


12877i30A57FC6363DA69E.png


12719i9528C3CA18360F1E.png


 


2. If the advanced condition evaluates to true then I set it to show a message.


11685i22C2C0DA0F7B8D5A.png


 


3. I Add a Else condition


4. If the advanced condition evaluates to false then the Else will show a message.


15934i109F4C4014F73352.png


 


5. So in other words the if Advanced Condition compares the two dates and resturns a message when it is equal but if the condition is not found as equal the the Else executes which returns a different message.


 


I recently had the same issue.  I wound up using the built-in Day Difference function and checking if the result of that was == 0.  This worked for me, but I was only looking for equal dates (not times).


Hi Junesh


 


Please confirm if the my last post was able to help you in achieving the question you had in regards with "I am using operator Not Equals to compare two calendar input fields,  but it seems doesn't work. The result is always not equal, even two calendar have the same value, e.g 2014/3/27. How can I fix it?"


 


Thank You in advance.


Reply