Search code examples
sqlsql-serverdatetimegetdate

Return First day of Financial Year(April 1st) T-SQL


First Day of financial year is April 1st.

T-SQL Query to return April 1st for the getdate()

Financial Year: April 1st to March 31st


Solution

  • Try this:

    select DATEFROMPARTS(Yr, 4, 1) [start], DATEFROMPARTS(Yr + 1, 3, 31) [end] from 
    (select case when DATEPART(month, getdate()) < 4 then DATEPART(year, getdate()) - 1 else DATEPART(year, getdate()) end Yr) a