Grabbing the previous 4 quarters
Your code is very procedural, with branching and variables and things we see in code... and bad queries. SQL likes sets/tables.

You're lucky your fiscal quarters line up with the "normal calendar" - every company I worked for had different periods for their fiscal calendar.

Since I worked with a data warehouse, one of the first things I do when I come on board in a company where I need to work with time data, is look at their databases to see if they have a table somewhere that contains their fiscal calendars. And if they don't have one, I simply create it:

create table dbo.FiscalCalendars (
     _Id int not null identity(1,1)
    ,_DateInserted datetime not null
    ,_DateUpdated datetime null
    ,CalendarDate date not null
    ,CalendarDayOfWeek int not null
    ,CalendarDayOfMonth int not null
    ,CalendarDayOfYear int not null
    ,CalendarWeekOfYear int not null
    ,CalendarMonthOfYear int not null
    ,CalendarYear int not null
    ,FiscalDayOfWeek int not null
    ,FiscalDayOfMonth int not null
    ,FiscalDayOfQuarter int not null
    ,FiscalDayOfYear int not null
    ,FiscalWeekOfMonth int not null
    ,FiscalWeekOfQuarter int not null
    ,FiscalWeekOfYear int not null
    ,FiscalMonthOfQuarter int not null
    ,FiscalMonthOfYear int not null
    ,FiscalQuarterOfYear int not null
    ,FiscalYear int not null
    ,constraint PK_FiscalCalendars primary key clustered (_Id asc)
    ,constraint NK_FiscalCalendars unique (CalendarDate)
);


With a table that stores everything you've always wanted to know about every date you ever need to know anything about, selecting the last 4 quarters becomes... simple:

declare @referenceDate as date;
set @referenceDate = getdate();

with quarters as (
    select
         t.FiscalYear
        ,t.FiscalQuarterOfYear
        ,min(t.CalendarDate) StartDate
        ,max(t.CalendarDate) EndDate
    from dbo.FiscalCalendars t
    group by
         t.FiscalYear
        ,t.FiscalQuarterOfYear
)
select top 4
     q.FiscalYear
    ,q.FiscalQuarterOfYear
    ,q.StartDate
    ,q.EndDate
from quarters q
where q.StartDate &lt;= @referenceDate
order by
     q.EndDate desc


The hardest part is ...populating that time table, not querying it.

Now, to make the above return a column for each quarter, you'll need to pivot it. But if you're working (and thinking) in sets (LINQ works off IEnumerable&lt;T&gt; after all), you won't need to do this.

Speaking of LINQ... assuming you have the time table mapped to FiscalCalendar entities, you could query it like this:

var referenceDate = DateTime.Today;
var quarters = context.FiscalCalendars
                      .GroupBy(t =&gt; new { t.FiscalYear, t.FiscalQuarterOfYear })
                      .Select(g =&gt; new { 
                                         FiscalYear = g.Key.FiscalYear,   
                                         FiscalQuarterOfYear = g.Key.FiscalQuarterOfYear, 
                                         StartDate = g.Min(q =&gt; q.CalendarDate),
                                         EndDate = g.Max(q =&gt; q.CalendarDate)
                                        })
                      .Where(q =&gt; q.StartDate &lt;= referenceDate))
                      .OrderByDescending(q =&gt; q.EndDate)
                      //.Skip(1) // skip current quarter?
                      .Take(4);


That would give you an IQueryable&lt;T&gt; where T is an anonymous type with int FiscalYear, int FiscalQuarterOfYear, DateTime StartDate and DateTime EndDate properties.