Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Using Parameters in Union Query
jperras
<p>Good Afternoon All, </p>
<p> </p>
<p>I am new to BIRT for Maximo and I am building a query based on two tables and combining the data via an SQL UNION statement. The issue I am having is when trying to build in parameters to feed into Maximo. I have to use the same parameters (Start date, end date, siteid) in both sections of the sql statement. I have tried a few of the basic ways to build parameters. I was able to get my query to work in BIRT using two parameters in each of the where clauses:</p>
<p> </p>
<p>and transdate >= " + MXReportSqlFormat.getStartDayTimestampFunction(params["startdate"]) + " "</p>
<p>and transdate <= " + MXReportSqlFormat.getStartDayTimestampFunction(params["enddate"]) + " "</p>
<p> </p>
<p>however, when I imported into Maximo I was unable to bind those to an attribute. The report wouldn't run. I then tried the following since I had success with this in another report. </p>
<p> </p>
<div>if(params["startdate"].value) {</div>
<div> sqlText += " and matrectrans.actualdate >= " </div>
<div> + MXReportSqlFormat.getStartDayTimestampFunction(params["startdate"]);</div>
<div>}</div>
<p> </p>
<p>However this didn't work either. My next thought was to build two data sets and join them somehow but as I said, I am new to this so I would have to teach myself how to do all that.</p>
<p> </p>
<p>I am at a loss for what to do next so if you have any advice on options please let me know. I can attach my report if needed. </p>
<p> </p>
<p>I am in Maximo 7.6 and using eclipse 4.3.1</p>
Find more posts tagged with
Comments
wwilliams
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">and transdate >= " + MXReportSqlFormat.getStartDayTimestampFunction(params["startdate"]) + " "</p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">and transdate <= " + MXReportSqlFormat.getStartDayTimestampFunction(params["enddate"]) + " "</p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">should be</p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"><span>and transdate <= " + MXReportSqlFormat.getEndtDayTimestampFunction(params["enddate"]) + " "</span></p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">if it doesn't work in Maximo. Make a string variable equal to the sqlText and display it in the header. Then cut and paste it in to Toad or Sql Server mgt console and see what happens</p>