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

demandé il y a un an3089 vues
2 réponses
1
Réponse acceptée

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
EXPERT
répondu il y a un an
0

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

répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions