revanthdubasi Posted May 17, 2016 Share Posted May 17, 2016 The output of my sql query shows the variable output in (dd/mm/yyyy). But the same variable in Ireport --> Query Wizard shows as (dd-mon-yy). I want to use the variable only for grouping purpose.Can anyone help how to get the value in dd-m-yyyy Link to comment Share on other sites More sharing options...
hozawa Posted May 17, 2016 Share Posted May 17, 2016 Set the pattern for the date field to "dd/mm/yyyy" or "dd-m-yyyy" or any Java valid date pattern. Link to comment Share on other sites More sharing options...
javier.ggi90 Posted May 17, 2016 Share Posted May 17, 2016 You can create a new Variable and write its expression as follows: new SimpleDateFormat("dd-M-yyyy").format($F{yourField})This converts your date into a String with the specified format which is useful for grouping. Javier 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