财政年度结束 [英] FINANCIAL YEAR CLOSE
问题描述
我有一个最初是这个SQL查询-
I have a SQL query which was initially this-
DELETE FROM table_1
WHERE column_1 IN ( SELECT column_1 FROM table_2 WHERE
column_3 < CURRENT - INTERVAL(N) MONTH TO MONTH)
现在,我的顾问已告知您使用财务结束年度,而不要使用CURRENT,例如:
Now my advisory has told to use Financial Close Year instead of CURRENT like:
DELETE FROM table_1
WHERE column_1 IN ( SELECT column_1 FROM table_2 WHERE
column_3 < FINANCIAL YEAR CLOSE - INTERVAL(N) MONTH TO MONTH)
3月底为财务年度结束.
FINANCIAL YEAR CLOSE being March End.
我不知道如何合并更改.
I have no idea as to how I should incorporate the changes.
推荐答案
由于财务年结"在一家公司与另一家公司之间可能不同,因此它不是内置函数,必须手动计算.
Since FINANCIAL YEAR CLOSE can be different from one company to another it is not a built in function and has to be calculated manually.
您需要使用CURRENT并从该日期中提取年份部分,并从[当前年份] -03-31创建一个新日期,然后在查询中使用该日期.
You need to use CURRENT and extract the year part from that date and create a new date from [current year]-03-31 and use that in your query.
有些谷歌搜索使我认为这是IBM的Informix数据库.
Some googling makes me think this is an Informix database from IBM.
这篇关于财政年度结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!