pathfinder2104.work Posted May 15, 2014 Posted May 15, 2014 Hi,I am using Jasper studio 5.5.1, I have created a report for bills created for a shop application. In my report if I choose the same date say 2014-05-15 00:00:00 to 2014-05-15 23:59:59. The reports are not being displayed although there is data related to this field and falls within the date range specified in database. I tried using this query.SELECT * FROM VIEW_BILLINGHISTORYWHERE dateCreated >= "FROM_DATE_VALUE_GOES_HERE" AND dateCreated<="TO_DATE_VALUE_GOES_HERE". I am not able to display any data in the report, the report generated is blank.
pathfinder2104.work Posted May 15, 2014 Author Posted May 15, 2014 From other questions I was inspired to convert to the java.util.Date to java.lang.String. Now still the trouble exists. I guess it has to do with the time format,Even if I specify "2014-05-15 00:00:00" and "2014-05-15 23:59:59" it accept it as "2014-05-15 12:00:00" and "2014-05-15 11:59:59" is this a BUG ??? or some other thing that I need to do and I am not doing????
pathfinder2104.work Posted May 15, 2014 Author Posted May 15, 2014 The reason why I come to this conclusion is that if I manually pass these dates as "2014-05-15 00:00:00" and "2014-05-15 23:59:59" I get the report generated with correct values but when I pass the same values from a java programe it is causing me the trouble that I mentioned in above comment.
hmurillop Posted August 11, 2014 Posted August 11, 2014 My solution for this problem. In this case i have 2 parameters, both are from prompt and class java.util.date: start_date ( default value = DATE(2014,01,01) ) end_date ( default value = new java.util.Date() ) And i have this "conditional" in my query SELECT... FROM... WHERE "here your date data column" BETWEEN CONVERT( DATE, $P{start_date} ) AND convert(varchar(25),convert(date,$P{end_date }) ) + ' 23:59'
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