You are not logged in.
Pages: 1
Hi everyone,
When i configure a report to use parameter of type date, parameter is send in the form '2015-04-14 -05:00:00', even if parameter is setup as date.
If try use formula in the form ${today} result is the same.
If try use formula in the form ${today.format(****)}, parse throw error.
It's is a bug ??
Regards
Offline
Hi,
the date parameter returns a Date object. If you have a column datecol of type DATE (or akin) and a date parameter with key date you should be able to use it as
SELECT * FROM MY_TABLE WHERE datecol < ${date}
Beware that the date object will come with minutes and seconds and thus a comparison usually needs to use date/time functions. Also, if the column that you are
testing against is not of type date but say a string of format YYYYMMDD then you would need to use a database date function to convert the date
into a string. Using format(**) in this case is not supported.
How are you currently using the parameter? Could you provide an example?
Cheers
-Arno
Offline
Hi,
format(**) is only to illustrate, format needed is format("yyyy-MM-DD").
When i try cast using function of Postgresql, an error is thrown.
Ex.
SELECT to_char(DATE ${day}, 'YYYY-MM-DD'), show error
**I understand that if, i set as type date, only part of the year, month, day should be returned by the object today.
Offline
Hi,
your SQL is wrong. What you would need here is something like:
SELECT to_char(${day}::date, 'YYYY-MM-DD') AS A
Cheers
-Arno
Offline
Hi Arno,
You are right.
Thanks
Offline
Pages: 1