EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB286179: SQL function MonthsBetween uses TRUNC instead of FLOOR Oracle function after upgrade to MicroStrategy 10.2


Community Admin

• Strategy


After upgrading MicroStrategy 9.4.1 to MicroStrategy 10.2. The following regression problem has been noticed: MicroStrategy 10.2 uses a different Oracle function to translate the MicroStrategy MonthsBetween function into SQL in the Oracle 11g database.

SYMPTOM:
After upgrading Strategy 9.4.1 to Strategy 10.2. The following regression problem has been noticed:
Strategy 10.2 uses a different Oracle function to translate the Strategy MonthsBetween function into SQL in the Oracle 11g database.
When using MonthsBetween function in a fact, the SQL generated in Strategy 10.2 uses TRUNC instead of FLOOR Oracle function.
- SQL generated in Strategy 9.4.1:

ka04W000000OfqMQAS_0EM4400000029Co.jpeg

- SQL generated in Strategy 10.2:

ka04W000000OfqMQAS_0EM4400000029Cr.jpeg

 
CAUSE:
This change reflects that after the calculation where the difference is negative, the result is incorrect.
Considering the following two dates: 28/02/2016 and 03/03/2016. The difference is one month, so the result of MonthsBetween function should be -1.
In version 9.4.1, which used FLOOR function to round the number the result was correct.
FLOOR(MONTHS_BETWEEN('28/02/2016', '03/03/2016'))
The result was -1.
In the version 10.2, which uses TRUNC function, the SQL looks like this:
TRUNC(MONTHS_BETWEEN('28/02/2016', '03/03/2016'))
The result is 0 which is incorrect.
 
ACTION:
Currently this issue is still being reviewed for feasibility by our Technology team and it is not scoped for any upcoming scheduled Strategy release.


Comment

0 comments

Details

Knowledge Article

Published:

June 12, 2017

Last Updated:

July 17, 2017