I've linked Google data studio with a MySQL database using the standard connector. Almost everything works fine except for date and datetime fields.
I have these 2 fields in phpmyadmin (field name, field type, output
):
- Validated_date datetime
2017-09-27 12:31:04
- Expiration_date date
2017-12-24
In Data Studio I've set these types, but none of them are recognised:
- Validated_date Date Hour (YYYYMMDDHH)
- Expiration_date Date (YYYYMMDD)
I tried to format the field with date_format in my SELECT:
DATE_FORMAT(p.Expiration_date, '%Y%m%d') AS "Expiration Date"
I even tried other date_formats but they're never recognised as dates in Data Studio:
DATE_FORMAT(p.Expiration_date, '%Y/%m/%d') AS "Expiration Date"
DATE_FORMAT(p.Expiration_date, '%Y-%m-%d') AS "Expiration Date"
Any idea?