【发布时间】:2022-06-16 19:56:52
【问题描述】:
我有这个查询,它可以正确解析表中的回历日期:
select convert(datetime ,my_col ,131) cc from my_table
where
my_col is not null;
它返回正确的数据:
2022-11-27 00:00:00.000
2022-11-24 00:00:00.000
2022-11-24 00:00:00.000
虽然这个给出了错误
select * from
(select convert(datetime ,my_col ,131) cc from my_table
where
my_col is not null
) ff where ff.cc < getdate();
Msg 242, Level 16, State 3, Line 12
The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value.
有什么帮助吗?
【问题讨论】:
-
你能提供一个minimal reproducible example吗?
标签: sql sql-server