Symptom
- Time missing.
- Date Time fields, shows as Date only.
- Database Fields Data Type shows as Date when connecting to MariaDB, when expecting a Date Time.
- When reporting off MariaDB data source in Crystal Reports using an ODBC connection, the Date Time fields shows as a Date only.
Environment
- SAP Crystal Reports 2016
- SAP Crystal Reports 2020
- MariaDB 10.3
Reproducing the Issue
- In Microsoft ODBC Data Source Administrator, create an ODBC DSN to MariaDB database using the ODBC Driver:
MySQL ODBC Connector 8.0.28
- In Crystal Reports, create a report based on an ODBC connection to a MariaDB database.
- Insert a Date Time field on the report.
- Refresh the report, and notice it only shows the Date, and not the Time for the Date Time fields.
Cause
- Crystal Reports send a standard SQL to obtain the Table and Fields information.
- The MySQL ODBC Connector 8.0.28 used to connect to MariaDB returns the incorrect data type for Date Time field, and this is why it shows the Data Type as Date, instead of Date Time.
- Important Note
MariaDB is not a supported data source for Crystal Reports.
For reference, see the Crystal Reports Supported Platforms documents found in the SAP Knowledge Base Article: 2859510
Resolution
- A suggestion is to use the MariaDB Connector ODBC driver 3.1.15, which returns the correct database fields data type of Date Time:
- From the MariaDB website, download the MariaDB Connector ODBC driver 3.1.15
- Install the MariaDB Connector ODBC driver 3.1.15
- In Microsoft ODBC Data Source Administrator, create an ODBC DSN to the MariaDB database using the ODBC Driver:
MariaDB Connector ODBC driver 3.1.15
- In Crystal Reports, create a report based on an ODBC DSN connection to the MariaDB
Keywords
CR, MariaDB , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem
Product
SAP Crystal Reports 2016 ; SAP Crystal Reports 2020