Skip to content
Advertisement

Showing what quarter of a financial year a date is in

I’m trying to construct a query that will map two columns, one, a date from a table, the second column an alias to show what quarter and financial year the date falls into.

Unfortunately I don’t have enough knowledge of SQL to know where to begin. I know that I’d do this with a combination of getdate() and dateadd(MONTH,,) however nothing that I’ve put together has come close to working.

To further complicate this the financial years in Australia go from 1st July- 30th of June so quarter one of financial year 2012 would start from July 1st 2012.

I can do this without a statement however I’d much rather have it in a statement as it’s going to be used in an SSRS report and a C# application and it would make maintenance significantly easier.

Advertisement

Answer

This should work:-

Output:-

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement