Calculate fiscal year in SQL Server

前端 未结 19 1451
时光说笑
时光说笑 2020-12-16 13:28

How would you calculate the fiscal year from a date field in a view in SQL Server?

19条回答
  •  失恋的感觉
    2020-12-16 13:43

    Simplest expression for this case: YEAR(DATEADD(month, 3, Date))

    The Federal Fiscal Year

    The fiscal year is the accounting period of the federal government. It begins on October 1 and ends on September 30 of the next calendar year. Each fiscal year is identified by the calendar year in which it ends and commonly is referred to as "FY." For example, FY2003 began October 1, 2002, and ends September 30, 2003... the intent was to provide Congress with more time to process appropriations legislation, particularly to avoid continuing resolutions.

    This may not apply to other countries and areas than the US, but you just have to replace the number 3 according to your needs.

提交回复
热议问题