Jump to content
JasperReports Library 7.0 is now available ×

date parameter in ireport


nyttle

Recommended Posts

Hi,

I want to filter data for a specific period. I defined two date parameters like $P{FromDate} and $P{ToDate}; but , when I run the report, I get all records without any filtering. this is my sql in the report-

select * from customer where trunc(createdate) between to_date($P{FromDate},'dd-mm-yyyy') and to_Date($P{ToDate},'dd-mm-yyyy').

I also tried like this

select * from customer where trunc(createdate)>= to_date($P{FromDate},'dd-mm-yyyy') and trunc(createdate)<=to_Date($P{ToDate},'dd-mm-yyyy').

 

I am using Oracle database and using Oracle datasource connection in the report.This sql runs perfectly in toad and returns the filtered resultset.

 

If I hardcode a value for the date instead of using parameter the report returns the filtered data.

 

If any one can help, please.

Thanks,

Nyttle

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 8 years later...

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...