Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 无法使用parse_date分析BigQuery中的输入字符串_Sql_Datetime_Google Bigquery - Fatal编程技术网

Sql 无法使用parse_date分析BigQuery中的输入字符串

Sql 无法使用parse_date分析BigQuery中的输入字符串,sql,datetime,google-bigquery,Sql,Datetime,Google Bigquery,我有一个字符串格式的“约会日期”列,表示日期dd.mm.yyyy 在BiqQuery中,我使用以下查询查找未来的所有约会日期: SELECT appointment_date FROM `appointments` where parse_date('%d.%m.%Y', appointment_date) > current_date() BiqQuery返回以下错误消息:无法分析输入字符串“” 请给我一些建议 谢谢, Janine使用safe.parse()避免错误: where

我有一个字符串格式的“约会日期”列,表示日期dd.mm.yyyy

在BiqQuery中,我使用以下查询查找未来的所有约会日期:

SELECT appointment_date
FROM `appointments` 
where parse_date('%d.%m.%Y', appointment_date) > current_date()
BiqQuery返回以下错误消息:无法分析输入字符串“”

请给我一些建议

谢谢, Janine

使用
safe.parse()
避免错误:

where safe.parse_date('%d.%m.%Y', appointment_date) > current_date()
这将返回无效格式的
NULL
,而不是错误。

使用
safe.parse()
避免错误:

where safe.parse_date('%d.%m.%Y', appointment_date) > current_date()
对于无效格式,这将返回
NULL
,而不是错误