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

KB45766: "You have an error in your SQL syntax" error message appears when running a report with attribute element filter in MicroStrategy Developer 9.3.1 against MySQL Warehouse


Stefan Zepeda

Salesforce Solutions Architect • Strategy


SYMPTOM:
"You have an error in your SQL syntax" error message appears when running a report with attribute element filter in Strategy Developer 9.3.1 against MySQL Warehouse as shown below:
 

ka02R000000kWz4QAE_0EM440000002CWl.png

 


QueryEngine encountered error: Execute Query failed. Error type: Odbc error. Odbc operation attempted: SQLExecDirect. [42000:1064: on SQLHANDLE][Strategy][ODBC MySQL Wire Protocol driver][MySQL]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '6:30:00 PM, 8/7/2010 8:43:20 AM)' at line 3 Connection string:

 
CAUSE: 
Some single quotes around the date values are missing in the SQL statement as shown below:
 

select from_unixtime(a11.Test_time/1000) Test_Time1
from `jimmy1` a11
where from_unixtime(a11.Test_time/1000) in (10/7/2013 6:30:00 PM, 8/7/2010 8:43:20 AM)

 
One possible cause for this issue is that the format of attribute form is set as "Datetime" while the data type of column alias is integer as shown below:
 

ka02R000000kWz4QAE_0EM440000002CWf.png

  
ACTION:
Change the data type of the column alias as "Varchar" or proper text format to get correct SQL as shown below:
 

ka02R000000kWz4QAE_0EM440000002CWj.png

 


select from_unixtime(a11.Test_time/1000) Test_Time2
from `jimmy1` a11
where from_unixtime(a11.Test_time/1000) in ('10/7/2013 6:30:00 PM', '8/7/2010 8:43:20 AM')

 
 


Comment

0 comments

Details

Knowledge Article

Published:

April 12, 2017

Last Updated:

April 12, 2017