Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Developing Analytics Applications
Working with multiple parameters
Migrateduser
<p>I have a problem running the 2 parameters of birt...</p>
<p> </p>
<p>The situation is that I will select an employee number first then selecting a date range to generate all the time in of an employee</p>
<p> </p>
<p>Here's my script</p>
<pre class="_prettyXprint _lang-">
today = new Date(); //sample database ends in May 2005
//today = new Date(); //real "today" value if not using sample database
df = new Packages.java.text.SimpleDateFormat("yyyy-MM-dd 00:00:00");
today = df.format(today);
if (params["Date Range"].value == "Custom Range"){
this.queryText = this.queryText + " where smartcomp.service.time_in between '" + params["StartDate"].value + "' and '" + params["EndDate"].value + "'";
}
else{
if (params["Date Range"].value == "Last 6 Months"){
rangeStart = DateTimeSpan.subDate(today, 0, 6, 0);
}
else if (params["Date Range"].value == "Last 12 Months"){
rangeStart = DateTimeSpan.subDate(today, 0, 12, 0);
}
else{
rangeStart = DateTimeSpan.subDate(today, 2, 0, 0);
}
rangeStart = df.format(rangeStart);
this.queryText = this.queryText + " where smartcomp.service.time_in between '" + rangeStart + "' and '" + today + "'"
}
if( params["NewParameter2"].value != "(AllEmployee)" ){
this.queryText = this.queryText + " where employee.employee_id = " + params["NewParameter2"].value
}
</pre>
<p>Generating all employee is working but when selecting a specific employee_id the error persist. "<b><span> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where employee.employee_id = 8' at line 6"</span></b></p>
<p> </p>
<p><b><span>Please help me solve this problem... thanks a lot</span></b></p>
Find more posts tagged with
Comments
There are no comments yet