Public Function DateOrdinalEnding(DateIn, MoIn As String)
' Will add an Ordinal ending to a date
' MoIn determines Month Format, i.e. "Feb" or "February"
If IsNull(DateIn) Then
DateOrdinalEnding = ""
Exit Function
End If
Dim dteX As String
dteX = DatePart("d", DateIn)
dteX = dteX & Nz(Choose(IIf((Abs(dteX) Mod 100) \ 10 = 1, 0, Abs(dteX)) Mod
10, "st", "nd", "rd"), "th")
DateOrdinalEnding = dteX & " day of " & Format(DateIn, " " & MoIn & " yyyy")
End Function
=======================
Then you can call it from a query:
Exp:DateOrdinalEnding([DateField],"mmmm")
or directly as control source of an unbound control in a report:
=DateOrdinalEnding([DateField],"mmmm")
Hope this helps.
--
Fred
Please reply only to this newsgroup.
I do not reply to personal e-mail.
"Rachel" <kpo...@wycokck.org> wrote in message
news:0de901c39341$4cf30c60$a001...@phx.gbl...
Worked like a charm! :-)
>.
>