Maximo List Archive

This is an archive of the Maximo Yahoo Community. The content of this pages may be a sometimes obsolete so please check post dates.
Thanks to the community owner Christopher Wanko for providing the content.



Unbounded date parameter fun

From: maximal (2018-06-20 15:44)

All right, here's the situation.

I am writing a report that will take a date as its only parameter, unbounded because I'm hitting ancillary tables. BIRT 4.3.1 hitting SQL Server 2012. I'm not as experienced with T-SQL as I am with PL/SQL so it's been a little slower than I'd like.

What I need is a transformation of the date into a week number and year number value for my crazy query.

What I have so far, which doesn't work:
WHERE DATEPART(wk,m.measuredate) = DATEPART(wk,'" + params["inDate"] +"') "
+ " AND DATEPART(yy,m.measuredate) = DATEPART(yy,'" + params["inDate"] +"') "
+ " AND DATEPART(dw,m.measuredate) = 2 "

And so "inDate" is coming from BIRT Report Designer as '2018-01-06' despite the fact that when I run "Preview" I am keying in '2018-06-09'. Also tried '2018-06-06' to no avail.

Does anyone have any pointers, references, suggestions as to formatting the date in such a way as to allow me to pass it to the SQL Server DATEPART function... or maybe use a BIRT function or Javascript function to do the same thing?

All I need is to extract the number 23 from the date to use with the week portion, and 2018 to use with the year portion, but I'm all tied in knots debugging it.

-C




From: maximal (2018-06-21 13:21)

Okay, I actually fixed that on my own and it worked all along, just needed to refresh Eclipse. So weird.

I've linked two reports and in Eclipse, they work fine. The summary report runs, generates a link, and clicking on the link launches the second report and shows all the goodness.

When I promote the pair of reports to Maximo, each will run individually just fine. However, the summary will run, and clicking the link results in "Unauthorized to run the report."

Which is weird, since I tried to preview this as MAXADMIN.

Can anyone help?

-C