D
David McCormack
I have a database that I'm trying to get a report to sort on my fiscal year.
I have a module that I set up (below) to set the dates for my fiscal year.
Function FiscalYear() As Date
Dim dtFiscalYear As Date
Dim strFiscalYear As String
Dim intMonth As Integer
intMonth = Month(Date)
'this will tell you the current month
If intMonth < 11 Then
strFiscalYear = "11/1/" & Year(Date) - 1
Else
strFiscalYear = "11/1/" & Year(Date)
End If
dtFiscalYear = CDate(strFiscalYear)
FiscalYear = dtFiscalYear
End Function
I then add the "Between FiscalYear() And Date()" to the date fields in my
queries. the queries are working great. My issue is that I'm trying to get
my reports to give the year-to-date based on the fiscal year but they keep
breaking them down to the calendar year. How do I set the sort feilds in the
report to sort by my fiscal year of Nov 1 to Oct 31?
I have a module that I set up (below) to set the dates for my fiscal year.
Function FiscalYear() As Date
Dim dtFiscalYear As Date
Dim strFiscalYear As String
Dim intMonth As Integer
intMonth = Month(Date)
'this will tell you the current month
If intMonth < 11 Then
strFiscalYear = "11/1/" & Year(Date) - 1
Else
strFiscalYear = "11/1/" & Year(Date)
End If
dtFiscalYear = CDate(strFiscalYear)
FiscalYear = dtFiscalYear
End Function
I then add the "Between FiscalYear() And Date()" to the date fields in my
queries. the queries are working great. My issue is that I'm trying to get
my reports to give the year-to-date based on the fiscal year but they keep
breaking them down to the calendar year. How do I set the sort feilds in the
report to sort by my fiscal year of Nov 1 to Oct 31?