Saquibhasan2007 Posted November 19, 2014 Share Posted November 19, 2014 I have a declared a date parameter end_date of data type date and I am passing a date value to it which needs to be compared with certain other date, say '2014-10-31' and based on this the output needs to come.. I have tried all of the following in the text field expression but the logic doesnt seem to work. Either there is compilation error or error in evaluating expression.($P{END_DATE} > '2014-10-31' ) ? 'Right' : 'Wrong'($P{END_DATE}.getDate() > ('2014-10-31').getDate() ) ? 'Right' : 'Wrong'($P{END_DATE}.getDate() > '2014-10-31') ? 'Right' : 'Wrong'Please help.. Thank You in advance Link to comment Share on other sites More sharing options...
Tiaguinho Posted November 16, 2015 Share Posted November 16, 2015 You trynew Date($F{my_date_field}) < new Date("2015-11-01") ? "minor" : "major"?? Link to comment Share on other sites More sharing options...
Tiaguinho Posted December 8, 2015 Share Posted December 8, 2015 solved with new Date().parse("yyyy-MM-dd",$F{my_date}.toString()).format("yyyy-MM-dd") >>>> if your date variable is a string.>=new Date().parse("yyyy-MM-dd",$P{report_date}).format("yyyy-MM-dd") >>>>> here the function .toString() is not necessary when you date is a Date Type variable ;) 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