Firstly, your problem is not related to the time value in the prompt value, but rather the time value in SomeDate . Getting rid of this (to make the date equal to midnight) will solve the problem.
Best of all, if you have the ability to change the universe, you need to create another object. I assume that you have an object called SomeDate whose SQL is a.somedate . Create another object, call it SomeDateOnly with the definition trunc(a.somedate) * **.
Since SomeDateOnly will always be a value at midnight, you can use Equal To with your prompts that will generate SQL like:
trunc(a.somedate) = @variable('Prompt1')
which, when rendered by WebI, will produce:
trunc(a.somedate) = '16-08-2016 00:00:00'
This will return all records using a.somedate between 8/16/2016 at 00:00:00 and 8/16/2016 23:59:59.
Of course, you can use BETWEEN to select a date range:
trunc(a.somedate) between @variable('Start Date') and @variable('End Date')
Even if you donโt have access to the universe, you can still use the above syntax by modifying the generated WebI SQL. (I guess you did anyway).
If the above works for you, then the following does not matter, but I would still like to refer to it:
The cause of the "invalid number" error you received is related to how the WebI format formats dates for SQL. If you have this line in your query:
A.SomeDate = TRUNC(@variable('Prompt1'))
then WebI will replace @variable (...) with the date string and display it as the following information before sending it to Oracle:
A.SomeDate = TRUNC('16-08-2016 00:00:00')
This, of course, does not make sense for the TRUNC () function, since there is nothing to say that it is actually a date value.
At first you can to_date execute the query, but you must use the correct date format. WebI sets nls_date_format for each session to a format other than the standard, so you will need to use:
A.SomeDate = TRUNC(to_date(@variable('Prompt1')),'dd-mm-yyyy hh24:mi:ss')
But then again, that doesn't matter, since you need a trunc SomeDate , not a prompt response value.
* Better yet, rename SomeDate to SomeDateTime and name the new object SomeDate
** This is quite common - having multiple objects for the same source field. Sometimes you need a date / time value (to list specific transactions), but sometimes you just need a date (to count transactions by date). Therefore, having both available is very helpful.