Most efficient way to calculate the first day of the current Financial Year?

Viewed 20332

What's the most efficient way to calculate the first day of the current (Australian) Financial Year?

The Australian FY begins on 01-July.

E.g.

SELECT dbo.FinancialYearStart('30-Jun-2011') returns 01-Jul-2010.

SELECT dbo.FinancialYearStart('01-Jul-2011') returns 01-Jul-2011.

SELECT dbo.FinancialYearStart('02-Jul-2011') returns 01-Jul-2011.

6 Answers
SELECT  cast(cast(YEAR(getdate())-
        (case 
            when MONTH(GETDATE()) between 1 and 6 then 1
            else 0
        end) as varchar)+'0701' as date)
Related