declare @table table
(
[Paid Date] date
)
insert into @table
values('20150102'),('20150512'),('20150830'),('20151231'),('20141230')
;WITH Quarters AS (
SELECT Q = 'Q1', MonthBegin = 1, MonthEnd = 3 UNION
SELECT Q = 'Q2', MonthBegin = 4, MonthEnd = 6 UNION
SELECT Q = 'Q3', MonthBegin = 7, MonthEnd = 9 UNION
SELECT Q = 'Q4', MonthBegin = 10, MonthEnd = 12
)
SELECT
[paid date],[Quarter] = 'FSY'+CONVERT(VARCHAR(4), DATEPART(yyyy, CONVERT(DATETIME, [paid date]))) + '_' + q.Q
FROM
@table
INNER JOIN Quarters q ON
DATEPART(m, CONVERT(DATETIME, [paid date])) >= q.MonthBegin AND
DATEPART(m, CONVERT(DATETIME, [paid date])) <= q.MonthEnd;
Output

Like this:
Like Loading...
About Prashanth Jayaram
DB Technologist, Author, Blogger, Service Delivery Manager at CTS, Automation Expert, Technet WIKI Ninja, MVB and Powershell Geek
My Profile:
https://social.technet.microsoft.com/profile/prashanth jayaram/
http://www.sqlshack.com/author/prashanth/
http://codingsight.com/author/prashanthjayaram/
https://www.red-gate.com/simple-talk/author/prashanthjayaram/
http://www.sqlservercentral.com/blogs/powersql-by-prashanth-jayaram/
Connect Me:
Twitter @prashantjayaram
GMAIL powershellsql@gmail.com
The articles are published in:
http://www.ssas-info.com/analysis-services-articles/
http://db-pub.com/
http://www.sswug.org/sswugresearch/community/
Very sleek, I can use this
LikeLike
Thanks
LikeLike
This is a good start for me but most financial years down here run from 1 April thru 31 March, or, 1 July thru 30 June 😦
LikeLike
Here is an easier way to get your results using your sample table and data:
select [Paid Date], convert(char(4),DATEPART(yyyy,[Paid Date])) + ‘_Q’ + convert(char(1),DATEPART(q,[Paid Date]))
from @table
LikeLike