Aparna_MU Posted September 23, 2015 Share Posted September 23, 2015 HiI am using Jaspersoft Studio 6.1.0. Community version. How to compare dates using greater than or equal to operators? E.g. in iReports I'm able to use the following expression:$F{Event_Scheduled_Date} >= TODAY() ? "*" : ""However, when I use th same in Jaspersoft Studio, while running the report I get the following error.The operator >= is undefined for the argument type(s) java.lang.String, java.lang.StringWhat syntax should I use to get the results?Thanks and kind regards,Aparna Link to comment Share on other sites More sharing options...
RamaKrishna.B Posted September 23, 2015 Share Posted September 23, 2015 hi,what is the data type of $F{Event_Scheduled_Date} ? Link to comment Share on other sites More sharing options...
hozawa Posted September 24, 2015 Share Posted September 24, 2015 You've set "$F{Event_Scheduled_Date} " to be a String instead of a Timestemp Link to comment Share on other sites More sharing options...
Aparna_MU Posted September 24, 2015 Author Share Posted September 24, 2015 data type of $F{Event_Scheduled_Date} is java.sql.Timestamp Link to comment Share on other sites More sharing options...
Aparna_MU Posted September 24, 2015 Author Share Posted September 24, 2015 Problem solved. I could keep the scheduled date as timestamp. But, changed the expression to the following:$F{Event_Scheduled_Date}.getTime() >= TODAY().getTime() ? "*" : " " This worked. 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