Getting an error when using a date parameter [Resolved]

0

I am using iReport 5.0.1. I created a date parameter and am using it in my query:

When I preview the report, I enter my date parameter:

After I enter all the parameters and run the report, I get this error:

Error filling print... Error executing SQL statement for : Sample
net.sf.jasperreports.engine.JRException: Error executing SQL statement for : Sample 
    at com.jaspersoft.jrx.query.PlSqlQueryExecuter.createDatasource(PlSqlQueryExecuter.java:143) 
    at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1086) 
    at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:667) 
    at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1258) 
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:877) 
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:822) 
    at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:61) 
    at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446) 
    at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:276) 
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:745) 
    at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:891) 
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) 
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) 
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "Feb" 
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592) 
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327) 
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192) 
    at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451) 
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350) 
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254) 
    at com.jaspersoft.jrx.query.PlSqlQueryExecuter.createDatasource(PlSqlQueryExecuter.java:136) 
    ... 12 more 

Print not filled. Try to use an EmptyDataSource...

What is going on here, and how do I fix this? Thanks!

 

Edit:

I figured it out. I had to change the $P!{start_date} to $P{start_date}

dizou's picture
32
Joined: Jan 11 2013 - 7:54am
Last seen: 6 years 8 months ago
Was it working on query window with default values ? Did you check the date format of you DB. Change the date format of Ireport in Tools->options->ireport->compilation and execution-->parameter prompt --> date format.
88.srivatsan - 6 years 9 months ago
Was it working on query window with default values ? Did you check the date format of you DB. Change the date format of Ireport in Tools->options->ireport->compilation and execution-->parameter prompt --> date format.
88.srivatsan - 6 years 9 months ago
I figured it out, see my edit.
dizou - 6 years 9 months ago

1 Answer:

1

Posting solution as an answer:

"I figured it out. I had to change the $P!{start_date} to $P{start_date}"

mgeise's picture
21077
Joined: Mar 5 2007 - 6:18am
Last seen: 2 months 1 week ago

Thanks!

dizou - 6 years 9 months ago
Feedback