【问题标题】:comparing parsed hijri date with getdate() returns error将解析的回历日期与 getdate() 进行比较返回错误
【发布时间】: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.

有什么帮助吗?

【问题讨论】:

标签: sql sql-server


猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-09-26
  • 2018-05-22
  • 2016-12-27
相关资源
最近更新 更多