You can start to fix your CASE Expression:
case when DATEPART(mm,[paid date]) in ('9','10','11') then 'FSY'+ Cast(Datepart(Year,[Paid date])as varchar(2)) + 'Q1'
when DATEPART(mm,[paid date]) in ('12','1','2') then 'FSY'+ Cast(Datepart(Year,[Paid date])as varchar(2))+ 'Q2'
When DATEPART(mm,[paid date]) in ('3','4','5') then 'FSY'+ Cast(Datepart(Year,[Paid date])as varchar(2))+'Q3'
when DATEPART(mm,[paid date]) in ('6','7','8') then 'FSY'+ Cast(Datepart(Year,[Paid date])as varchar(2))+'Q4' else 'N/A' end Qtr
No comments:
Post a Comment