djelebovk Posted January 20, 2016 Share Posted January 20, 2016 Hi guys,I have this simple query:SELECT date_trunc('day', purchase_date), COUNT(*) FROM purchases GROUP BY date_trunc('day', purchase_date);[/code]When I want to parametrize the query:SELECT date_trunc($P{period}, purchase_date), COUNT(*)FROM purchases GROUP BY date_trunc($P{period}, purchase_date);[/code]I am getting this error: ".... purchases.purchase date must appear in GROUP BY ... " both on jasper server 5.2.0 and on iReport Studio 5.6.0First I've thought that the issue is with the driver. I've updated it and now I am using the latest one: "postgresql-9.4.1207"... again I get the same error. Then I've tested the driver by writting a tiny java program that does the same and it worked.Thanks in advance, KostaP.S.The example query is simple but the one I want to have in production is quite complex and I don't find a meaningful way to work around the use of such GROUP BY statement.P.S.2OMG I hate this editor 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