Hi,
I want to apply the following logic:
-if '$createdate eq $datetimeoriginal or $createdate or $datetimeoriginal'
so do something but only if the dates don't differ unless only one is defined.
($createdate alone is fine, same for $datetimeoriginal but if both are defined they must be the same)
Try this:
-if '$createdate and $datetimeoriginal and $createdate ne $datetimeoriginal'
This will do something only if both dates exist and are different.
- Pil
Yes, -if 'not ($createdate and $datetimeoriginal and $createdate ne $datetimeoriginal)' does what I want but
what was wrong with my code? Is or not supported?
Your example only works if both CreateDate and DateTimeOriginal don't exist, which is different that what you said in your first post.
Did you try the version Phil listed?
Quote from: StarGeek on June 12, 2020, 08:01:53 PM
Your example only works if both CreateDate and DateTimeOriginal don't exist, which is different that what you said in your first post.
Did you try the version Phil listed?
If you want use "or" then one of the following will work - depending on what you want to happen if neither field exists:
-if '$createdate eq $datetimeoriginal or !($createdate) or !($datetimeoriginal)'
-if '($createdate eq $datetimeoriginal or !($createdate) or !($datetimeoriginal)) and ($createdate or $datetimeoriginal)'