Jump to content
Changes to the Jaspersoft community edition download ×

default time values for beginning and end of time?


Recommended Posts

I'm trying to understand how to set up some default values to support an optional date range on a query.


So I've got a column that's a java.sql.Date called datesubmitted. What I'm trying to set up is a query that does something like


select * from datatable 
where datesubmitted between $P(RANGESTARTDATE} and $P{RANGEENDDATE}
order by datesubmitted


I've got two parameters set up as java.sql.Timestamp values - RANGESTARTDATE and RANGEENDDATE.


I'm trying to set up a default so that RANGESTARTDATE is "beginning of time" and RANGEENDDATE is "end of time". I tried


[code]new java.sql.Timestamp(0) and
new java.sql.Timestamp(Long.MAX_VALUE)


respectively. However, if I run the report and indicate "Use default" (through iReport 1.3.0), I get "document has no pages". If I use the prompts in iReport to select 2 dates, I get the correct set of results.


What's the incantation to create the start and end dates I need to essentially select all the records if I don't pass in the parameter values?



Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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