How to compare two dates when they are coming in the String format?
Posted on April 28, 2016 at 3:05am
I want to know for suppose I have a date '10/FEB/2014' and I want to compare it to '15/02/2014'
Both of the dates are in String format and they have diffferent formats I want to know which one is a greater date ?
Posted on April 28, 2016 at 3:36am
This is just a very simple Java problem. Suggest that you learn Java before trying to use JasperReports.
((new SimpleDateFormat("dd/MM/yyyy")).parse("15/02/2014")).after(((new SimpleDateFormat("dd/MMMM/yyyy",Locale.ENGLISH)).parse("10/FEB/2014")))
Posted on April 28, 2016 at 3:44am
its not working its giving me a compilation error at first .parse
Posted on April 28, 2016 at 8:04pm
I forgot to mention, Expression Editor in Jaspersoft Studio is buggy and sometimes returns error when there is none.
Just save the expression and preview to execute.