Im trying to display dates from Firestore Database in BigQuery.
Here is an example of my Firestore Document๐
I would like to display this timestamp, "f58-sodleDate", in BigQuery as 2023-10-3.
In BigQuery Console, I wrote this code ๐
json_extract(data, '$.f58-sodleDate'),
and I get this ๐ {"_seconds":1691471596,"_nanoseconds":483000000}
And if I write this code, ๐
parse_datetime("%c", JSON_VALUE(DATA, '$.f58-sodleDate')) as dte,
// or this code
JSON_EXTRACT_SCALAR(DATA, '$.f58-sodleDate') AS dte,
I get the query result as null, like this๐
And if I write this code๐
date(timestamp_seconds(cast(json_extract(data, '$.f58-sodleDate') as int64))) AS dte,
I get this error message๐
What I want for my query result is something like this๐

I achieved this by writing this code ๐
FORMAT_DATE('%F', timestamp) as dte,
Please tell me what I have to do to achieve the result I want..
Thank you, best. - STW



Top comments (0)