fabian.fuentez Posted January 25, 2019 Share Posted January 25, 2019 I am trying to to create an expression that compares dates and a string. This expression uses an and, if, and or statement. I am trying to acheive a 1 if the value returns true but always returns a null value when i run it can anyone help? Thanks. Here's the expression:IF($F{RFS_GRADE_CODE} == "EE" && $F{STU_ENR_ENTRY_DATE}.before( $P{EffDate} ) && $F{STU_ENR_EXIT_DATE} ==null || $F{STU_ENR_ENTRY_DATE}.before( $P{EffDate}) && $F{STU_ENR_EXIT_DATE}.after( $P{EffDate}) ,"1","0") Link to comment Share on other sites More sharing options...
Solution akovach Posted January 26, 2019 Solution Share Posted January 26, 2019 Hi,It is not receommended to use '==' with String values. Use $F{RFS_GRADE_CODE}.equals("EE") instead. This is because the == operator only compares object references, while the String.equals() method compares both String's values i.e. the sequence of characters that make up each String Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now