Hello,
I have an if then statement that is not recognizing one date (2018-01-16) is after (2017-12-29). The statement looks like this: If 2018-01-16<2017-12-29 then true otherwise false. It keeps saying false. I have made sure the field names are set as dates and it still won't recognize it. So then I hard coded with the dates in the example and it still won't work. I took this code from a Business Objects report so I know the logic is correct. I just don't understand why it doesn't recognize the date?
Any ideas?
Solved! Go to Solution.
@kpombo When you say If "2018-01-16" < "2017-12-29", I would expect it to return false because 2018 is not less than 2017. If you wanted to check that the first date of your argument is after the second argument, you would just want to flip your inequality around to if "2018-01-16" > "2017-12-29" which will return true since 2018 is after 2017. Let me know if it's still not working as expected!
@marqueecrew I formatted both of the fields (not the hard coded dates) as dates but it still won't work.
are you saying even with both fields as dates it should still be ">" then "<"
I'll send you a webex if you'd like, but please check this:
[Early Date] < [Later Date] = True Result
See I formatted both fields as dates when I didn't hard code and use the "<" and it still wouldn't work but works just fine and returns correct results in Business Objects. I will try it flipped with the two fields set as dates!
I get it and it makes sense to me! I just don't understand why it was working so well in Business Objects (maybe it was just dumb luck?) Thanks for the help!