Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图从 Informix 的任何一个内置日期函数中提取年份, TODAY或者CURRENT
TODAY
CURRENT
有没有办法做到这一点SUBSTR()?
SUBSTR()
是:使用YEAR功能:
YEAR
SELECT YEAR(TODAY) FROM SysMaster::SysDual;
对于 MONTH、DAY、WEEKDAY (0..6) 也是如此。您可以使用 CURRENT 而不是 TODAY,但这会生成一个 DATETIME 值,然后将其转换为 DATE 并进行分析。