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
Designing Analytics Reports
Date parameters: Oracle SQL
Migrateduser
<p>Hi,</p>
<p> </p>
<p>As part of my dataset, I have the following conditions in the SQL:</p>
<p> </p>
<div>...and</div>
<div>trunc(creation_date) >= to_date('01/12/2013', 'dd/mm/yyyy') and</div>
<div>trunc(creation_date) <= to_date('31/12/2014', 'dd/mm/yyyy')...</div>
<div> </div>
<div>These dates need to become parameters, but I can't get BIRT to send the right format. Presuming that the SQL looks like this for the two parameters (they're a start and end date)...</div>
<div> </div>
<div>
<div>...and</div>
<div>trunc(creation_date) >= to_date(?, 'dd/mm/yyyy') and</div>
<div>trunc(creation_date) <= to_date(?, 'dd/mm/yyyy')...</div>
<div> </div>
<div>I would expect the SQL wants a string passed to it rather than a dateTime object.</div>
<div>There's logic for both dates: </div>
<div>Start date is currently:</div>
<div>BirtDateTime.addMonth(BirtDateTime.firstDayOfMonth(BirtDateTime.today()),-12)</div>
<div> </div>
<div>End date is currently:</div>
<div>BirtDateTime.addDay(BirtDateTime.firstDayOfMonth(BirtDateTime.today()),-1)</div>
<div> </div>
<div>Is the best course to convert this to a string in dd/mm/yyyy format with quotation marks added?</div>
<div> </div>
<div>Thanks in advance.</div>
</div>
<p> </p>
Find more posts tagged with
Comments
There are no comments yet