How would you calculate the fiscal year from a date field in a view in SQL Server?
Given @FiscalYearStartMonth is your fiscal year start month (numeric)
and @Date is the date in question, do the following:
SELECT
CASE
WHEN @FiscalYearStartMonth = 1 OR @FiscalYearStartMonth > MONTH(@Date)
THEN YEAR(@Date)
ELSE YEAR(@Date) + 1
END AS FiscalYear
You can abstact this away in a function, or use as a column in a derived view