INVALID_CAST_ARGUMENT: Cannot cast '' to DOUBLE - Error

0

I have been using the below statement to retrieve the sum of all the values from that column as shown below SUM(CAST(column1 AS DOUBLE)) as cnt but now it is erroring out with the below error

INVALID_CAST_ARGUMENT: Cannot cast '' to DOUBLE This query ran against the "imdsout" database, unless qualified by the query. Please post the error message on our forum or contact customer support with Query Id: 004997cb-e355-445c-b502-28ecd8f8aaaf

已提問 1 年前檢視次數 3091 次
2 個答案
1
已接受的答案

Hi, does column1 contain empty string? If so it will throw a cast error.

If so, make sure to use where clause to excluded unwanted values such as ‘’.

Hope it helps ;)

profile picture
專家
已回答 1 年前
0

Thank you @alatech. Yes it did contain empty string. Once I excluded it works.

已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南