Categories
- All Categories
- Oracle Analytics and AI Learning Hub
- 44 Oracle Analytics and AI Sharing Center
- 20 Oracle Analytics and AI Lounge
- 278 Oracle Analytics and AI News
- 56 Oracle Analytics and AI Videos
- 16.2K Oracle Analytics and AI Forums
- 6.4K Oracle Analytics and AI Labs
- Oracle Analytics and AI User Groups
- 103 Oracle Analytics and AI Trainings
- 20 Oracle Analytics and AI Challenge
- Find Partners
- For Partners
Calculate number of days for February in a leap year - MOD Functon in OBIEE 11g
Hello,
I am trying to calculate number of days in February for different years. How do I deal with a leap year? I found this formula online but I am not sure if MOD function works in OBIEE 11g.
(CASE WHEN Month (“Table Date”.”Date”) IN (1, 3, 5, 7, 8, 10, 12) THEN 31
WHEN Month (“Table Date”.”Date”) IN (4, 6, 9, 11) THEN 30
ELSE (CASE WHEN (MOD (YEAR (“Table Date”.”Date”), 4) = 0 AND MOD (YEAR (“Table Date”.”Date”), 100)! = 0) OR (MOD (YEAR (“Table Date”.”Date”), 400) = 0) THEN 29
ELSE 28 END) END)
Appreciate any inputs or alternate solutions. Thanks in advance.
Answers
-
OBIEE_Drool wrote: I am not sure if MOD function works in OBIEE 11g.
Yes, MOD is an OBIEE 11g function
Selected Mod Syntax MOD(expr1, expr2)
Where expr is any expression that evaluates to a numerical value.
Example Description Divides the first numerical expression by the second numerical expression and returns the remainder portion of the quotient.
0 -
Sorry it was the spaces that were causing the syntax issue. Thanks @Gianni Ceresa
0
