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

passing in start/end date results in java exception


patricia.williams

Recommended Posts

My postgres db has a date field and pgadmin query 

    select * from contribution_info where contribution_dt between '2015-01-01' and '2015-12-31'

results in a dt field like "2015-06-15" .  When I try to preview my studio report i get prompts for StartDate and EndDate and I fill those in with 2015-01-01 and 2015-12-31 respectively.  However, I get the java exception then that says net.sf.jasperreports.engine.JRException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date

What am I doing wrong?  Here's the snippet of dataset query that has the date clause 

  and c.contribution_dt between $P{StartDate} and $P{EndDate}

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

here's what the server shows on the where clause when I push it over to the server and run it there

    from contribution_info c

    inner join contribution_persent cp on  c.contribution_info_id=cp.contribution_info_id
    inner join persent_info p on cp.persent_info_id=p.persent_info_id
    inner join persent_address pa on p.persent_info_id=pa.persent_info_id
    inner join address_info a on pa.address_info_id=a.address_info_id
   inner join report_info r on c.report_info_id=r.report_info_id
   where 1=1
   and c.contribution_dt between ? and ?
   and (lower(p.name_last) like 'vandergrif' or lower(p.name_organization) like 'vandergrif') 
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...