Hi,
Is there a way in SQL Server that can show the Fiscal Year (begins on October 1 and ends on September 30) from a table which has a date column (1998 to 2010). Here is what I have done:
select 'FY1999' as FY, site, count(*) from mytable
where mydate >='10/1/1998' and mydate <'10/1/1999'
group by site
select 'FY2000' as FY, site, count(*) from mytable
where mydate >='10/1/1999' and mydate <'10/1/2000'
group by site
select 'FY2001' as FY, site, count(*) from mytable
where mydate >='10/1/2000' and mydate <'10/1/2001'
group by site
Isn't it too much repetitive when doing this for more then 10 FY year?