Using a Sql Result in Default Value of Dashboard Prompt
599807Nov 20 2007 — edited Feb 3 2008Hi,
I Create a Dashboard Prompt, this have two dates, the initial and the last for a period to filter. I need to set the default value in the fist and last date of the previous month, for example, if today is 20th of november the default value of initial date has been 1th of October and the last date has been 31th of october.
I used in default the option 'SQL Results' and use the next sentences:
SELECT TRUNC(add_months(sysdate, -1), 'MM') FROM dual;
SELECT TRUNC(last_day(add_months(sysdate, -1))) from dual;
But when I try to use the dashboard prompt the result is:
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <(>: Syntax error [nQSError: 26012] . (HY000)
SQL Issued: SELECT TRUNC(add_months(sysdate,-1),'MM') FROM dual
When I try to use only select sysdate from dual; the result is:
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27004] Unresolved table: "dual". (HY000)
Thanks for your help.