Feeds:
Posts
Comments

Archive for February, 2014

DECLARE @Date AS DATETIME = ‘2014-05-01’

DECLARE @FirstDayAUFinancialYear AS DATETIME =  

   DATEADD( MONTH (MONTH(@Date) 1)/ 6 * 12 6 CAST(CAST(YEAR(@Date) AS VARCHAR) ASDATETIME) )

 

DECLARE @LastDayAUFinancialYear AS  DATETIME =

    DATEADD(DAY,1,DATEADD(MONTH, 12, @FirstDayAUFinancialYear))   

 

SELECT @FirstDayAUFinancialYear AS FirstDay, @LastDayAUFinancialYear AS LastDay

 

Output:

FirstDay                                        LastDay
2013-07-01 00:00:00.000          2014-06-30 00:00:00.000

Read Full Post »

%d bloggers like this: