Function DateFilter(fStart As Boolean) As Date
'True will return Start Date, False will return End Date
Dim StartDate As Date
Dim endDate As Date
Select Case DATE
Case #1/1/2003# To #1/31/2003#
StartDate = #1/1/2003#
endDate = #1/31/2003#
Case #2/1/2003# To #2/28/2003#
StartDate = #2/1/2003#
endDate = #2/28/2003#
Case #3/1/2003# To #3/31/2003#
StartDate = #3/1/2003#
endDate = #3/31/2003#
Case #4/1/2003# To #4/30/2003#
StartDate = #4/1/2003#
endDate = #4/30/2003#
Case #5/1/2003# To #5/31/2003#
StartDate = #5/1/2003#
endDate = #5/31/2003#
Case #6/1/2003# To #6/30/2003#
StartDate = #6/1/2003#
endDate = #6/30/2003#
Case #7/1/2003# To #7/31/2003#
StartDate = #7/1/2003#
endDate = #7/31/2003#
Case #8/1/2003# To #7/31/2003#
StartDate = #8/1/2003#
endDate = #7/31/2003#
Case #9/1/2003# To #9/30/2003#
StartDate = #9/1/2003#
endDate = #9/30/2003#
Case #10/1/2003# To #10/31/2003#
StartDate = #10/1/2003#
endDate = #10/31/2003#
Case #11/1/2003# To #11/30/2003#
StartDate = #11/1/2003#
endDate = #11/30/2003#
Case #12/1/2003# To #12/31/2003#
StartDate = #12/1/2003#
endDate = #12/31/2003#
End Select
If fStart = True Then
DateFilter = StartDate
Else
DateFilter = endDate
End If
End Function