I face a problem with SQL query in JasperSoft studio. I am trying to get records from posgreSQL database from between two dates. I use this statement:
SELECT spent_on FROM time_entries WHERE spent_on BETWEEN date '2014-01-01' AND date '2014-11-1' ORDER BY spent_on DESC
or simpler but with the same problem:
SELECT spent_on FROM time_entries WHERE spent_on BETWEEN '2014-01-01' AND '2014-11-1'
also using < and > ends the same way.
spent_on column is defined as: spent_on date NOT NULL.
When I run this query in pgAdmin I get all rows I expected to receive, however when I try the same statement in JasperSoft Studio I get none.
I found out that I can get some rows when I change range to: "between date '2012-01-01' and date '2014-11-1'" and the last entry I get is from 2012-05-29. (where in database last one is from 2014-11-12)
Database store data for Redmine.
SOLVED
Reason: different schema used in Jaspersoft Studio and pgadmin.