Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Sql Query INTERVAL
Ingo
Hi,
I'm currently trying to parameterize the following sql-statement but I cannot get it to work..
select * from ****
where ****.time > sysdate - INTERVAL '30' DAY
When I try to simply replace the 30 with ? I get an error taht the parameter index could not be found. When I try to exchange '30' with ? using a string parameter I got the message that the query isn' ended properly.
Any suggestion on how to set up a query like this?
Thanks,
Ingo
Find more posts tagged with
Comments
Tianli
You can try specify the query in Property Binding of dataset:
"select * from ROOT.ORDERS where ROOT.ORDERS.ORDERDATE < sysdate - INTERVAL " + params["p1"] + " DAY"
the params["p1"] is a String type report parameter named p1.
Ingo
Hi,
thanks for the quick answer... I tried it but I cannot get it to work. You placed the whole query in the property binding field?
can you send a report where have done something like that?
Thanks,
Ingo
Tianli
The query in property binding works in runtime preview, so it doesn't work in dataset preview. I will try to find why the ? in dataset query doesn't work
Ingo
Thanks,
I think the ? is maybe masked with the ' in the query but without them the sql query does not work either.