I have a column which states month and year YYYY MM
. I've separated those into two columns (Year
and Month
). The problem is, the year is the calendar year whereas ideally I need the fiscal year I use (Apr 01
to Mar 31
- This will never change).
Other solutions I've seen are based on date format, whereas my original column is string.
I need a statement that returns the fiscal year for my new year column instead of the calendar year.
My current statement is:
Select Month,
parsename(replace(Month,' ','.'),1) as MonthM,
parsename(replace(Month,' ','.'),2) as Year
FROM TblTrade
Which works to separate the columns.
So expected results would be for example: Feb 15 becomes Feb and 2015. Apr 15 becomes Apr and 2016.
Please advise.