I suggest you create a few function to get the fiscal year, semi fiscal year, semi calendar year, to make your query clear and neat.
for example:
Code:
Function fiscalYear(ddate As Date) As Long
'fiscalyear(11/1/2010) = 2010,
'fiscalyear(06/1/2010) = 2009
If Month(ddate) >= 10 Then
fiscalYear = Year(ddate)
Else
fiscalYear = Year(ddate) - 1
End If
End Function
Function fiscalSemiYear(ddate As Date) As Long
If Month(ddate) < 4 Then
fiscalSemiYear = Year(ddate) * 2 - 2
ElseIf Month(ddate) >= 4 And Month(ddate) <= 9 Then
fiscalSemiYear = Year(ddate) * 2 - 1
Else
fiscalSemiYear = Year(ddate) * 2
End If
End Function
Function SemiYear(ddate As Date) As Long
'semiyear(11/1/2010) = 2010 * 2 + 1 = 4021
'semiyear(06/1/2010) = 2010 * 2 + 0 = 4020
If Month(ddate) >= 7 Then
SemiYear = Year(ddate) * 2 + 1
Else
SemiYear = Year(ddate) * 2
End If
End Function
then in your query, you can use following expressions:
Code:
1. Is the completion date within the same Calendar Year
year(todate)=year(date())
2. Is the completion date within the same Fiscal Year (1 Oct to 30 Sep)
fiscalYear(todate)=fiscalYear(date())
3. Is the completion date within the current Calendar Year semi-annual period
semiYear(todate)=semiYear(date())
4. Is the completion date within the current Fiscal Year semi-annual period
fiscalSemiYear(todate)=fiscalSemiYear(date())
5. How many days since the course completed (for past courses)
datediff("y", todate, date())
6. How many days until the course completes (current/future courses)
datediff("y",date(), todate)