Categories
- All Categories
- 15 Oracle Analytics Sharing Center
- 14 Oracle Analytics Lounge
- 212 Oracle Analytics News
- 42 Oracle Analytics Videos
- 15.7K Oracle Analytics Forums
- 6.1K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 78 Oracle Analytics Trainings
- 14 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
OTBI Dashboard Prompt Timestampadd Formula for Default End Date Covering through EOD 11:59:59pm

I needed to default the begin and end date dashboard prompt for First Day of Previous Month through Last Day of Previous month using the following timestamp formulas respectively:
First Day of Previous Month:
TIMESTAMPADD(SQL_TSI_MONTH, -1, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))
Last Day of Previous Month:
TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))
My Time Zone is (- 5 GMT Eastern USA and Canada), I set the time zone in the prompt to default.
I get the following default values in the prompt:
The Begin Date is what I want: 12/01/2024 12:00:00 AM
The End Date goes only to 12/31/2024 12:00:00 AM. I the value I want would be 12/31/2024 11:59:59 PM to pick up all the records through the last day of previous month.
I've tried putting in a - 1 second value into the End Date default formula above to no avail.
How can I accomplish my goal above please?
Answers
-
Hi @User_VGJDM,
Please try the following Queries, it is working for me.
FDoPM:
SELECT
CAST((CAST(TIMESTAMPADD(SQL_TSI_MONTH, -1, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) AS CHAR)) AS TIMESTAMP) s_1
FROM "Absence Management - Leave Donations Real Time"LDoPM:
SELECT
CAST((SUBSTRING(CAST(TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) AS CHAR) FROM 1 FOR 10) || ' ' || '23:59:59') AS TIMESTAMP) s_1
FROM "Absence Management - Leave Donations Real Time"I'm getting the following results using the above:
Hope this help.
Cheers,
0 -
0