Hi All,
I'm looking for a way to figure out the current financial year in SQL.
I'm creating a rolling report thats going to be emailed out via report centre once a month. If it were executed today, it should contain all details from '2010-04-01' and '2011-03-31'.
I want to avoid having to updating the dates manually in the report every year, but can't figure out how I'd work out the current financial year.
I've tried every combination of DATEPART, DATENAME, DATEDIFF, and GETDATE I can think of.. but I must be missing something.
Any ideas?
Thanks
I'm looking for a way to figure out the current financial year in SQL.
I'm creating a rolling report thats going to be emailed out via report centre once a month. If it were executed today, it should contain all details from '2010-04-01' and '2011-03-31'.
I want to avoid having to updating the dates manually in the report every year, but can't figure out how I'd work out the current financial year.
I've tried every combination of DATEPART, DATENAME, DATEDIFF, and GETDATE I can think of.. but I must be missing something.
Any ideas?
Thanks