quantzie Posted October 29, 2010 Share Posted October 29, 2010 Hi everyone! I am having some problems with some time output. I've created 2 parameters:FROM_TIMETO_TIMEand these are in java.sql.timestamp. These 2 are my time inputs. These 2 parameters are then transferred to another 2 parameters called TIME1TIME2 where the expressions for them are new java.text.SimpleDateFormat(" kk:mm:ss").format($P{FROM_TIME}) and new java.text.SimpleDateFormat(" kk:mm:ss").format($P{TO_TIME}). This is to change them to a time format in hours, minutes and seconds. I need this step because it is passed back into my SQL queryand r."rec-time" >= date_part('hour',(('2000-01-01' ||$P{TIME1})::timestamp)) * 3600 + date_part('minute',(('2000-01-01' ||$P{TIME1})::timestamp)) * 60 + date_part('second',(('2000-01-01' || $P{TIME1})::timestamp))and r."rec-time" <= date_part('hour',(('2000-01-01' ||$P{TIME2})::timestamp)) * 3600 + date_part('minute',(('2000-01-01' || $P{TIME2})::timestamp)) * 60 + date_part('second',(('2000-01-01' || $P{TIME2})::timestamp)) Since my data is calculated in seconds, this is the only method that I can think of. Whenever I use preview, everything works perfectly. But when I upload my report onto the Jasper repository and run the report, a Date/time input of FROM_TIME and TO_TIME using 9:00:00 and 17:00:00 becomes 9:09:09 and 17:17:17. Does anyone know why it is running fine in iReports but once it is being used in the repository, it bugs up the time input? Link to comment Share on other sites More sharing options...
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