dboutin Posted November 17, 2009 Share Posted November 17, 2009 Hi,Is it possible to use a script as this one inside a variable of iReport ? java.util.Calendar calendar =new java.util.GregorianCalendar(); calendar.setTime(new java.util.Date($F(My_Date)));calendar.get(java.util.Calendar.YEAR); Regards, Denis. Link to comment Share on other sites More sharing options...
sjongenelen Posted November 17, 2009 Share Posted November 17, 2009 yes, as long as make it in one line :)make it easier on yourself to get the date from your DB as Date (field)(new java.util.GregorianCalendar().setTime($F{date}).get(java.util.Calendar.YEAR)perhaps you can make multiple variables to make it easier OR try to use the SQL functions of your db... for example, i use the WEEK() function of MySQL:select WEEK(customer.dob) as weeknumber_dob from customerPost Edited by sjongenelen at 11/17/2009 15:29 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