<p>Hello guys,</p>
<p>I am new to BIRT, and so I got one question. I connected my sql database to birt , and it works really good (database : MySQL)</p>
<p>So here is my question:</p>
<p><strong>I got this script in my dataset "beforeOpen":</strong></p>
<p> </p>
<div>today = new Date(2015,12,31); //sample database ends in May 2005</div>
<div>//today = new Date(); //real "today" value if not using sample database</div>
<div>df = new Packages.java.text.SimpleDateFormat("yyyy-MM-dd");</div>
<div>today = df.format(today);</div>
<div> </div>
<div> </div>
<div>if (params["Date Range"].value == "Custom Range"){</div>
<div>this.queryText = this.queryText + " where contentfiles.Timestamp between '" + params["StartDate"].value + "' and '" + params["EndDate"].value + "'";</div>
<div>}</div>
<div>else{</div>
<div>if (params["Date Range"].value == "Last 6 Months"){</div>
<div>rangeStart = DateTimeSpan.subDate(today, 0, 6, 0);</div>
<div>}</div>
<div>else if (params["Date Range"].value == "Last 12 Months"){</div>
<div>rangeStart = DateTimeSpan.subDate(today, 0, 12, 0);</div>
<div>}</div>
<div>else{</div>
<div>rangeStart = DateTimeSpan.subDate(today, 2, 0, 0);</div>
<div>}</div>
<div> </div>
<div>rangeStart = df.format(rangeStart);</div>
<div> </div>
<div>this.queryText = this.queryText + " where contentfiles.Timestamp between '" + rangeStart + "' and '" + today + "'";</div>
<div> </div>
<div>}</div>
<div> </div>
<div><strong>and my SQL is: </strong></div>
<div> </div>
<div>
<div>SELECT contentfiles.Community,</div>
<div>SUM(contentfiles.Downloads) AS Downloads, </div>
<div>contentfiles.Timestamp</div>
<div>from contentfiles </div>
<div>GROUP BY contentfiles.Community</div>
<div>ORDER BY contentfiles.Downloads DESC</div>
<div> </div>
<div> </div>
<div>My Parameter works really good, but just until the point, I type in the GROUP BY and ORDER BY part. So without those commands it works perfectly, but why doesn´t it work when I use those commands? </div>
<div> </div>
<div> </div>
<div><u>This is the Error I am getting:</u></div>
<div> </div>
<div><b>org.eclipse.birt.report.engine.api.EngineException: Cannot get the result set metadata. org.eclipse.birt.report.data.oda.jdbc.JDBCException: SQL statement does not return a ResultSet object. SQL error #1:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'where contentfiles.Timestamp between '2015-07-31' and '2016-01-31'' at line 7 ; com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'where contentfiles.Timestamp between '2015-07-31' and '2016-01-31'' at line 7</b></div>
<div> </div>
<div> </div>
<div>I would really appreciate any help

</div>
<div>Thanks alot </div>
</div>
<p> </p>