heila.mckinley Posted July 16, 2019 Share Posted July 16, 2019 I have a report which takes as an input parameter a date using the date picker. The date is stored as an Epoch date in SQL Server.When I run the report in Jaspersoft Studio it works. The relevant bit of query looks like this: and cr.open_date + 7200 >= datediff(ss, '19700101', '$P!{Open Date from}' )I publish the report to Jaspersoft Server and when I try to run it I get error below. What am I doing wrong? The server has encountered an error. Please excuse the inconvenience.Error MessageError filling reportError Messagenet.sf.jasperreports.engine.JRException: Error executing SQL statement for: BCC Tickets created.Error Messagejava.sql.SQLDataException: [Tibcosoftware][sqlServer JDBC Driver][sqlServer]Conversion failed when converting date and/or time from character string. Link to comment Share on other sites More sharing options...
Scott Andersen Posted October 18, 2023 Share Posted October 18, 2023 I would use the java.util.Date.getTime() method to get the epoch, and compare the epoch field using that parameter.Create a second parameter (name it OpenDateFromEpoch) that performs that translation, and use the second parameter in the query.Something like :and cr.open_date >= $P{OpenDateFromEpoch}' 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