faulknerwilliam2 (9/15/2015)
HelloI have a report that uses the Datepart function to return the current, and previous, year's data:
DATEPART(YEAR, a.Date);
DATEPART(YEAR, a.Date) = DATPART(YEAR, GetDate())-1
This brings through calendar year fine.
Is it possible to amend this to bring through the financial year (e.g. 1/4/15 - 31/3/16)?
Any advice much appreciated.
Following expression will do
IIF(DATEPART(MONTH, a.Date) >= 4, DATEPART(YEAR, a.Date) + 1, DATEPART(YEAR, a.Date))
hope it helps