0
votes

I did the following to convert DATE into a DATE STRING

SELECT 
cast(date(from_unixtime(time)) as date_string) as dateid
from table A

but was returned an error - line 3:1: Unknown type: date_string. Does anyone know what is wrong with my CAST syntax?

1
What is a date_string? Why not just use something like varchar(255)? - Gordon Linoff
Meaning to convert it into a string of text instead of being in a date format - Rosellx

1 Answers

0
votes

You need something like:

CAST(your_date_value AS varchar)

(replace "date_string" with "varchar")