jbon007 (1/27/2011)
Hi all,i have this function which is not fully working. what it does is look at the date and work out our financial year. (financial year is from 1 april to 31 march)
for example for financial year 2010-04-01 to 2010-03-01
I would like to show
2010/11 2010-04-01
2010/11 2010-05-01
.
.
.
.
2010/11 2011-01-01
2010/11 2011-02-01
2010/11 2011-03-01
the function i use is this-
ALTER function [dbo].[fFinYear] (@FM char(6))
returns char(7)
as
begin
return
left(@FM,4)+
case
when substring(@FM,3,2)='99' then '/00'
when substring(@FM,3,2)+1<10 then '/0'+rtrim(convert(varchar(2),substring(@FM,3,2)+1))
else '/'+rtrim(convert(varchar(2),substring(@FM,3,2)+1))
end
end
what this does is
2010/11 2010-04-01
2010/11 2010-05-01
.
.
.
.
2011/12 2011-01-01
2011/12 2011-02-01
2011/12 2011-03-01
I would like it to stay 2010/11 to end of march and once it reaches april then increase to 2011/12. I would be ever greatful if someone can help me on this?
Parapharsing here, the new fiscal year (2011/12, now called 2012 for my purposes) start on 2011-04-01 an ends on 2012-03-31, correct?