I have been trying to create a financial aging report. To do that, I have used a db2 sql with "days(date(@ARDATE as date)) - days(date(of char string for ar dates) as invoicedays". The ARDATE is a datetime report parameter.
This statement works fine in the Execute Query option as well as the Report Designer Preview. Unfortunately, when the report is published to our database, the invoicedays values show as zero.
If I replace days(date(@ARDATE as date)) with days(current date), the calculation of days shows the correct values when published.
Note: The @ARDATE works with <=, >= or between in db2 sql so I think the format of data from the datepicker is '2016-03-10:hh:mm:ss'.
Note: I can also change the parameter type to string and use csv data source as '2015-12-31, 2016-01-31,2016-02-29, etc to get the report to work.
How do I get the report to accept the @ARDATE from within the sql statement?