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)
Limit Report to 30 days of history and six months form today
RConti
<p><span style="font-size:medium;">[font="calibri;"]I am building a shop floor loading graph and only want to show 30 days back (past due) from the current date and six months into the future.[/font]</span></p><p> </p><p><span style="font-size:medium;">[font="calibri;"]I have the graph grouping set to one week intervals and summed. Weekly totals are displayed but the data set is too large. We have jobs that run out to 2015 and we do not need them on the shop floor loading graph. The data is on an IBM i5 with a DB2 database. [/font]</span></p><p> </p><p><span style="font-size:medium;">[font="calibri;"]Could the limit be done in the SQL or would it be best accomplished with BIRT Eclipse Ver 3.6.2 Parameters?[/font]</span></p><p> </p><p><span style="font-size:medium;">[font="calibri;"]The SQL for the data set is attached.[/font]</span></p><p> </p><p><span style="font-size:medium;">[font="calibri;"]Thank you,[/font]</span></p><p><span style="font-size:medium;">[font="calibri;"]Rob[/font]</span></p>
Find more posts tagged with
Comments
micajblock
<p>Always best to filter on the database.</p>
RConti
<p>As a novice I need help with the actual SQL. Could someone please post the SQL that will accomplish the date limits.</p><p> </p><p>Thank you in advance,</p><p>Rob</p>
micajblock
<p>I am not sure about DB2 but for SQL Server it would be</p><pre class="_prettyXprint">DDATE between DATEADD("D",-30,GETDATE()) and GETDATE()</pre><p>If I read the online (Google is your freind) SQL manuals correctly then it is:</p><pre class="_prettyXprint">DDATE between CURRENT DATE -30 DAYS and CURRENT DATE</pre>
bgbaird
<p>Actually, I think you can include both dates in the same statement:</p><p> </p><p><span>DDATE between DATEADD</span><span>(</span><span>"D"</span><span>,-</span><span>30</span><span>,</span><span>GETDATE</span><span>())</span><span> </span><span>and</span><span> DATEADD("M",6,GETDATE</span><span>()</span>)</p><p> </p><p>Brian</p>