Hi
I have a requirement where in need to get month of the current date and compare it with interger.How is it possible in jasper?
if month(CurrentDate)>=7
then year(CurrentDate)+1
else
year(CurrentDate)
Could anyone help me on this date to interger comparision
?
Thanks in Advance
1 Answer:
Posted on December 7, 2017 at 2:06am
Hello,
you can create a calculated field in AdHoc designer and use MonthNumber() which returns month number. Please find more info on the calculated fields at the following URL.
Warm regards,
I achieved this.
Integer.parseInt(new SimpleDateFormat("MM").format(new Date()))>=7?Integer.parseInt(new SimpleDateFormat("YYYY").format(new Date()))+1:
Integer.parseInt(new SimpleDateFormat("YYYY").format(new Date()))