Casting string to date

Hi,

I have a date field in the format yyyy-mm-dd and in string type. How do I convert the string type to date type in looker?

I tried using cast and also datatype fields, giving an error.

Lookml code - dimension: e_date {
                              type: date
                              datatype: date
                              sql: CAST(${TABLE}.e) ;;
                          }

Error - Query execution failed: - Syntax error: Unexpected ")" 

How to resolve this error?

Thanks in advance.

0 1 12.7K
1 REPLY 1

What is your dialect? You forgot to include what you are casting to

CAST(${TABLE}.e AS DATE)
Top Labels in this Space
Top Solution Authors