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

KB37779: "The conversion of a varchar data type to a datetime data type resulted in an out-of-range value" error message appears when using ApplySimple to manipulate data of datetime data type in MicroStrategy 9.4.x and 10.x


Community Admin

• Strategy


"The conversion of a varchar data type to a datetime data type resulted in an out-of-range value" error message appears when using ApplySimple to manipulate data of datetime data type in MicroStrategy 9.4.x and 10.x

SYMPTOM:
 
The attribute form expression is defined as follows: 
Sql
ApplySimple("case when #0 < '27.07.2012' then 3
when #0 between '27.07.2012' and '27.07.2013' then 2
else 1 end", )
 
When running the report in Developer, the following error is returned:
 
Sample Code/Error
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value
 
 

ka04W000000OhY7QAK_0EM440000002DYn.jpeg

CAUSE:
 
The datetime format of the date column on warehouse database side is not the same as the one specified in ApplySimple statement.
 
ACTION:
 
Use the datetime format defined on warehouse database side in the ApplySimple statement.
 
For instance, if the datetime format is defined as yyyy-mm-dd on warehouse database side, the form expression needs to be modified as follows: 
Sql
ApplySimple("case when #0 < '2012-07-12' then 3
when #0 between '2012-07-12' and '2013-07-12' then 2
else 1 end", )
  
 
 


Comment

0 comments

Details

Knowledge Article

Published:

May 16, 2017

Last Updated:

May 16, 2017