Fiscal Year

Bone_12 361 Reputation points


I have a field called date_app_in which is formatted as yyyy-mm-dd

What I need to create if possible is a financial year flag that ideally would output something like FY22/23.

The financial year runs from April to March.

So if my date was between 1st April 2022 - 31st March 2023, I would like my new field (name Fiscal_Year_ to output as FY22/23.

Is that possible with my date variable?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
9,739 questions
Azure Database for PostgreSQL
{count} votes

2 answers

Sort by: Most helpful
  1. Viorel 94,261 Reputation points

    Check this query too:

    select date_app_in,   
        format(dateadd(month, -3, date_app_in), '"FY"yy"/"') + format(dateadd(month, 9, date_app_in), 'yy') as Fiscal_Year  
    from MyTable  
    0 comments No comments

  2. Tom Phillips 17,631 Reputation points

    Create a calendar table to calculate the value and never think about it again.


    0 comments No comments