SQL Get Financial Year (April to March)

The following query will return the financial year starting April to March

YEAR(DATEADD(Month,-((DATEPART(Month,StartDate)+8) %12),StartDate))

SELECT YEAR(DATEADD(Month,-((DATEPART(Month,’2014-03-31′)+8) %12),’2014-03-31′))
SELECT YEAR(DATEADD(Month,-((DATEPART(Month,’2014-04-01′)+8) %12),’2014-04-01′))
SELECT YEAR(DATEADD(Month,-((DATEPART(Month,’2014-12-31′)+8) %12),’2014-12-31′))
SELECT YEAR(DATEADD(Month,-((DATEPART(Month,’2015-03-31′)+8) %12),’2015-03-31′))
SELECT YEAR(DATEADD(Month,-((DATEPART(Month,’2015-04-01′)+8) %12),’2015-04-01′))

The results are

 

FinancialYearAprilMarch.JPG

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s