Function WhichQuarter(ByRef dteToAllocate As Date) As String
'Jim Cone - San Francisco USA - October 2005
Const Q1End As Date = #3/31/2005#
Const Q2End As Date = #6/30/2005#
Const Q3End As Date = #9/30/2005#
Const Q4End As Date = #12/31/2005#
Select Case True
Case dteToAllocate <= Q1End
WhichQuarter = "Date occurs in First Quarter "
Case dteToAllocate <= Q2End
WhichQuarter = "Date occurs in Second Quarter "
Case dteToAllocate <= Q3End
WhichQuarter = "Date occurs in Third Quarter "
Case dteToAllocate <= Q4End
WhichQuarter = "Date occurs in Fourth Quarter "
End Select
End Function
'Call function
Sub FindQuarter()
MsgBox WhichQuarter("07/30/2005")
End Sub
"jwmott" <
[email protected]>
wrote in message
I need to determine whihc fiscal quarter a date falls in. The begin and end
dates fo the fiscal year are user defined.