[FONT=Fixedsys]Option Explicit[/FONT]
[FONT=Fixedsys][/FONT]
[FONT=Fixedsys]' Q1 FY11 - if the date falls between 1/nov/10 and 31/jan/11
' Q2 FY11 - if the date falls between 1/feb/11 and 30/apr/11
' Q3 FY11 - if the date falls between 1/may/11 and 31/jul/11
' Q4 FY11 - if the date falls between 1/aug/11 and 31/oct/11[/FONT]
[FONT=Fixedsys][/FONT]
[FONT=Fixedsys]Public Function GetQuarter(ByVal aDate As Date) As String[/FONT]
[FONT=Fixedsys][/FONT]
[FONT=Fixedsys] Application.Volatile
Dim iYear As Integer
Dim iMonth As Integer
iYear = Year(aDate)
iMonth = Month(aDate)
Select Case iMonth
Case 11, 12
GetQuarter = "Q1"
iYear = iYear + 1
Case 1
GetQuarter = "Q1"
Case 2, 3, 4
GetQuarter = "Q2"
Case 5, 6, 7
GetQuarter = "Q3"
Case 8, 9, 10
GetQuarter = "Q4"
End Select
GetQuarter = GetQuarter & " FY" & Right(CStr(iYear), 2)[/FONT]
[FONT=Fixedsys][/FONT]
[FONT=Fixedsys]End Function
[/FONT]