Here is a function I use for Fiscal Year
Function (datevar Tdate)
// WhatFY - What Fiscal Year does this date fall in
// Input: Tdate, the date to be tested
// Output: Fiscal year as a 4 digit string
// Example: WhatFY(2/3/2003) = 2003 WhatFY(10/4/2003) = 2004
if month(Tdate) < 7 then totext(year(Tdate),'####') else totext(year(Tdate)+1,'####') ;