如何使用日期过滤 informix 中的日期时间列
How can i filter a datetime column in informix with a date
我想在 informix 12.10 中过滤日期时间列。
我得到了以下“测试”table
name
insert_date
create_date
...
2022-04-06 11:03:22.000
....
...
2022-03-02 12:03:22.000
....
...
2021-02-04 11:15:22.000
....
...
2021-01-05 11:03:22.000
....
我的做法如下
SELECT * FROM test where insert_date < "01.01.2022"
我收到错误:
SQL-Error [IX000]: Non-numeric character in datetime or interval.
如何在 informix 中过滤带有日期(没有时间)的日期时间列?
根据documentation应该是1
select *
from TEST
where INSERT_DATE < DATETIME (2022-1-1) YEAR TO DAY
1假设列INSERT_DATE的数据类型为DATETIME YEAR TO FRACTION.
我想在 informix 12.10 中过滤日期时间列。
我得到了以下“测试”table
name | insert_date | create_date |
---|---|---|
... | 2022-04-06 11:03:22.000 | .... |
... | 2022-03-02 12:03:22.000 | .... |
... | 2021-02-04 11:15:22.000 | .... |
... | 2021-01-05 11:03:22.000 | .... |
我的做法如下
SELECT * FROM test where insert_date < "01.01.2022"
我收到错误:
SQL-Error [IX000]: Non-numeric character in datetime or interval.
如何在 informix 中过滤带有日期(没有时间)的日期时间列?
根据documentation应该是1
select *
from TEST
where INSERT_DATE < DATETIME (2022-1-1) YEAR TO DAY
1假设列INSERT_DATE的数据类型为DATETIME YEAR TO FRACTION.