Categories
- All Categories
- Oracle Analytics and AI Learning Hub
- 39 Oracle Analytics and AI Sharing Center
- 20 Oracle Analytics and AI Lounge
- 276 Oracle Analytics and AI News
- 50 Oracle Analytics and AI Videos
- 16.2K Oracle Analytics and AI Forums
- 6.4K Oracle Analytics and AI Idea Labs
- Oracle Analytics and AI User Groups
- 102 Oracle Analytics and AI Trainings
- 17 Oracle Analytics and AI Challenge
- Find Partners
- For Partners
Query with function on SYSDATE not work in BI Publisher Reports
Summary
Query with function on SYSDATE not work in BI Publisher Reports
Content
Hi,
I have a problem with function for SYSDATE, where this query work on SQL Developer but not work in BI Publisher. I can said more: query works fine in BI Publisher in Data model for "Save like sample data" but not work when I generate report from this data model.
function:
--description: I want to take from year before today and take from three months before that date.
in clause WHERE TO_CHAR(table.UNLOADINGDATE, 'YYYY-MM') >= TO_CHAR((ADD_MONTHS((TO_DATE((SUBSTR(TO_CHAR(SYSDATE, 'YYYY'), 0, 4)-1)) || '-' || TO_CHAR(SYSDATE, 'MM-DD')), -3)), 'YYYY-MM')
Can anyone help?
Answers
-
I don't understand need to break the SYSDATE in the YYYY and MM-DD format because if you say "want to take from year before today and take from three months before that date"
means 15 months before today's date?
Can we directly try add_months(sysdate,-15)
0 -
Brajesh thanks, of course you are right! I don't know why I tried to do my life harder.
0