• What day does your standard week begin on, Saturday, Sunday, Monday,...?

    As an aside, this is the kind of stuff I would put into my calendar table. So, if you do not have a calendar table in your system you should consider getting one. And if you do, or once you do, you would have a column called fiscal_calendar_year that stored that data point for every date in your table. At that point the answer for which fiscal year a day belongs to is trivial to lookup. Granted, you have to write the logic to populate said column on the calendar table but the date math you're dealing with is tough to read and tough to debug and having the values in a table just makes this kind of work simple as there will certainly be a need for many more variations in the course of building a system that has dependencies on dates. If you happen to want to stick with the date-math I would definitely recommend locking whatever solution you choose into an inline table-valued function so you never have to copy and paste the date-math code in multiple places and it will be easy to write unit tests against.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato