I am trying to convert an integer (e.g. 20211008) to a string format (2021-10-08) to use as a primary key in a separate sub-query. I have tried the following:
primary_key = cast(PARSE_DATETIME(cast(integer as VARCHAR),'yyyyMMdd') as date) but receive an error: =' cannot be applied to varchar, date"
7 Related questions 178 Typecast string to integer 249 How do I convert an integer to string as part of a PostgreSQL query? 9 Postgres convert integer into text Related questions 178 Typecast string to integer 249 How do I convert an integer to string as part of a PostgreSQL query? 9 Postgres convert integer into text 4 Presto - hex string to int 5 Format int as date in presto SQL 0 Select Numbers Before and After String Values - Presto SQL 0 Inserting decimals in string with Presto 6 Convert array(double) to varchar in Presto 0 string to integer in postgres 2 convert int to string in postgresql? Load 7 more related questions Show fewer related questions Reset to default