I need a Function that I can run from within a Query that will take a date from a table and spit out which half of the year (First or Second) it falls in. I am pretty new to functions, but here is what I have so far:
Function DateAnnual(AnnumDate As Variant) As String
Dim HALF As Variant
Dim WhichHalf As String
HALF = Format (AnnumDate, "mm")
If HALF <=6 Then
WhichHalf = "FIRST"
ElseIf HALF >6 Then
WhichHalf = "Second"
End If
End Function
In my query I create an expresstion field called with the following: ANNUMateAnnual([WO_Create_Date])
When I run the query nothing seems to get passed back to the query field (read blank). Any help would be appreciated.
James
Function DateAnnual(AnnumDate As Variant) As String
Dim HALF As Variant
Dim WhichHalf As String
HALF = Format (AnnumDate, "mm")
If HALF <=6 Then
WhichHalf = "FIRST"
ElseIf HALF >6 Then
WhichHalf = "Second"
End If
End Function
In my query I create an expresstion field called with the following: ANNUMateAnnual([WO_Create_Date])
When I run the query nothing seems to get passed back to the query field (read blank). Any help would be appreciated.
James