I have a function wrote in a module that will return fiscal month of our calendar as following.
Function getDueMonth(Due Date As Date)
Dim DueMonth As Integer
Set fd = New clsFiscalDate
fd.SetDate = DueDate
DueMonth = fd.MonthNumber
'Debug.Print DueMonth
End Function
The print value is correct by using Debug.
I want to use this function in one of my queries but it seems it is not correctly called. No record shows using this query although some records exist. Could anyone give me hints to do this.
My query is as following
"SELECT Grade.studentNa me, Grade.score FROM Grade WHERE Grade.dueMonth = getDueMonth(Now ());
Function getDueMonth(Due Date As Date)
Dim DueMonth As Integer
Set fd = New clsFiscalDate
fd.SetDate = DueDate
DueMonth = fd.MonthNumber
'Debug.Print DueMonth
End Function
The print value is correct by using Debug.
I want to use this function in one of my queries but it seems it is not correctly called. No record shows using this query although some records exist. Could anyone give me hints to do this.
My query is as following
"SELECT Grade.studentNa me, Grade.score FROM Grade WHERE Grade.dueMonth = getDueMonth(Now ());
Comment