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 NEXT_DAY( trunc(date)) in open script
Stry
Hi All,
I have developed a report query in Toad that works. I want to create a maximo report based on this.
however when I create a maximo report in Eclipse the dataset is empty.
The report will be run from maximo.
Here is the open script:
maximoDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName());
maximoDataSet.open();
var sqlText = new String();
// Add MM-Maximo query to sqlText variable.
sqlText = " SELECT WORKORDER.CNR_AREA, "
+ " WORKORDER.WONUM, "
+ " WORKORDER.DESCRIPTION, "
+ " LONGDESCRIPTION.LDTEXT LONG_DESC, "
+ " WORKORDER.LOCATION, "
+ " TRUNC(WORKORDER.ACTSTART) ACTSTART, "
+ " TRUNC(WORKORDER.ACTFINISH) ACTFINISH, "
+ " WORKORDER.ESTDUR, "
+ " WORKORDER.LEAD, "
+ " WORKORDER.WOPRIORITY, "
+ " WORKORDER.STATUS "
+ " FROM WORKORDER , LONGDESCRIPTION "
+ " WHERE " + params["where"]
+ " AND WORKORDER.WORKORDERID = LONGDESCRIPTION.LDKEY(+) "
+ " AND LONGDESCRIPTION.LDOWNERCOL = 'DESCRIPTION' "
+ " AND LONGDESCRIPTION.LDOWNERTABLE = 'WORKORDER' "
+ " AND WOCLASS = 'WORKORDER' AND WOPRIORITY IN (6, 7) "
+ " AND WORKORDER.ACTSTART BETWEEN NEXT_DAY(TRUNC(SYSDATE - 14), 'monday') AND NEXT_DAY(TRUNC(SYSDATE - 7), 'sunday') "
+ " ORDER BY WORKORDER.CNR_AREA ASC";
maximoDataSet.setQuery(sqlText);
If I comment out the ACTSTART BETWEEN line the report works and data is returned. as soon as I add that line back, datset returns empty. the idea is I want start dates that fall in the privous week from the sysdate.
Can I not use the NEXT_DAY function, if not what are my opions?
Thanks for the help
Find more posts tagged with
Comments
micajblock
Try 'MONDAY' and 'SUNDAY'.
Stry
<blockquote class='ipsBlockquote' data-author="'mblock'" data-cid="90445" data-time="1323239773" data-date="06 December 2011 - 11:36 PM"><p>
Try 'MONDAY' and 'SUNDAY'.<br /></p></blockquote>
<br />
Thanks for the reply however changing to MONDAY, SUNDAY didn't change anything.<br />
Preview of dataset is still empty.
micajblock
<blockquote class='ipsBlockquote' data-author="'Stry'" data-cid="90774" data-time="1323294591" data-date="07 December 2011 - 02:49 PM"><p>
Thanks for the reply however changing to MONDAY, SUNDAY didn't change anything.<br />
Preview of dataset is still empty.<br /></p></blockquote>
<br />
Maybe JDBC does not support this syntax. Try using JavaScript to create the date strings and then use TO_DATE.
vijay_kota
Hi Stry,
Your Query perfect...
i tried the same in BIRT 2.3.2...its working good....
are you sure you are having enough data in that range....??
try modifying the range....
Nothing wrong in the query...