eg of function, create in a standard code module:
Function fnReturnMonth(iNumber As Integer) As String
Select Case iNumber
Case 1
fnReturnMonth = "Jan"
Case 2
fnReturnMonth = "Feb"
Case 3
fnReturnMonth = "Mar"
Case 4
fnReturnMonth = "Apr"
Case 5
fnReturnMonth = "May"
Case 6
fnReturnMonth = "Jun"
Case 7
fnReturnMonth = "Jul"
Case 8
fnReturnMonth = "Aug"
Case 9
fnReturnMonth = "Sep"
Case 10
fnReturnMonth = "Oct"
Case 11
fnReturnMonth = "Nov"
Case 12
fnReturnMonth = "Dec"
End Select
End Function
then call the funtion in your query:
select fnReturnMonth(numberfield) as "MyMonth",
field1, field2 .....etc
from your_table
|