Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

doing date comparisons

Status
Not open for further replies.

scroce

MIS
Nov 30, 2000
780
US
I think this is pretty self explanatory - I know that the syntax is wrong - but can someone point me in the correct direction of what i'm trying to do here?

Public Function FiscalYear(MyDate) As String


Select Case MyDate

Case #7/1/1998# > MyDate > #6/30/1999#
FiscalYear = "FY98"
Case #7/1/1999# > MyDate > #6/30/2000#
FiscalYear = "FY99"
Case #7/1/2000# > MyDate > #6/30/2001#
FiscalYear = "FY00"
Case Else
FiscalYear = "Not Found!"

End Select


End Function

Thanks in advance. How much more water would there be in the ocean if it weren't for sponges?
 
sorry - i posted in the wrong message board - i'm doing this in excel vba - if anyone cares, the answer is this:

Case #7/1/1998# To #6/30/1999#
FiscalYear = "FY98"
Case #7/1/1999# To #6/30/2000#
FiscalYear = "FY99"
Case #7/1/2000# To #6/30/2001#
FiscalYear = "FY00"
Case Else How much more water would there be in the ocean if it weren't for sponges?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top