Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
kbromwich
Starting Member
5 Posts |
Posted - 2008-10-03 : 02:15:38
|
| i need a sql statement that i can supply a date range and it will calculate all the fiscal years within that date range.the fiscal year for this will be 1 jul - 30 Jun following year.exampleuser asks for data from 2000 to 2008data returned would be00/01 calculated data01/02 calculated data02/03 calculated dataetci was hoping to do this in one sql statement. i was playing with a case statement but that does not seem to be working.cheers |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-03 : 02:31:42
|
| [code]SELECT YEAR(DATEADD(mm,DATEDIFF(mm,0,datefield)+5,0)),calaculationsFROM YourTableGROUP BY YEAR(DATEADD(mm,DATEDIFF(mm,0,datefield)+5,0))[/code] |
 |
|
|
|
|
|