I need to compare two dates in entity filter. How to do it?
To clarify some of the above posts, for some reason it's not possible to use the "greater than", "greater than or equal to", "less than" and "less than or equal to" operators when you compare a Variable of type Date with a Variable of type Date Time. It is possible to compare a Date and a Date Time with the "equal" operator, however.
As has been mentioned above, to overcome this, simply convert the Date Variable to a Date Time by using the built-in DateToDateTime() Function.
And as Behavioral mentioned, since the NullDate() is actuall 1900-01-01, it also compares like that (i.e. NullDate will always be less than a valid, contemporary, date).
Hi Brajesh,
What is your doubt there?You can compare dates with the usual "<" ">" "=" "<>" operators, just like any other attribute type.
Hello I am in need of some assistance I need to subtract the date they put in the input calender minus the current date to figure out how old they are can someone please help me with this.
Use DiffDays, DiffMinutes, etc. to compare dates.
J.Ja
Hello
The Justin solution works, however we can not use João Rosado solution
Alberto Ferreira wrote:
Hello,
Try
SyntaxEditor Code Snippet
DiffDays( DateTimeToDate( date ) , otherDate))
João Rosado solution WORKS if you compare 'Date Time' with 'Date Time' ot 'Date with 'Date', you can also convert 'Date' to 'Date Time' or reverse. It is the easiest way to compare two dates using < > =.
Hi,
Just want to warn that null date is 01-01-1900. You can use nulldate() to compare in this case.
Please be careful!!!