Jump to content
We've recently updated our Privacy Statement, available here ×

How to get a value date field from DB


my.nguyen

Recommended Posts

Hello,

 

i am newbee so please help with my stupid question!

Postgsql DB, field name: CreateDate (TimeStamp)

I created report in jasperSoft Studio have a fieldname CreateDate.

How can I set the value for the field CareteDate=2015 only in the report?

I tried in express Editor: Integer.valueOf(2015).equals($F{createdate}) : it's not working right :(

Please advise, Thank you.

MN

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

If you want to display/fetch only YEAR from CreatedDate then:

In TextField Expression give it as: YEAR(CreatedDate), this will return you year from passed date.

To get only 2015, then new Integer(YEAR(CreatedDate))==2015.

To filter data, you can update the query to return data of 2015 year.

Best Regards,

JasperExplorer

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...