
Displaying: date: 1st, 2nd, 3rd, 11th, 21st
Bob,
Place this in a Module:
Public Function DateOrdinalEnding(DateIn, MoIn As String)
' Will add an Ordinal ending to a date
' i.e. Novermber 13th, 2000
' MoIn determines Month Format, i.e."mmm" = "Feb" or "mmmm" =
"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 = Format(DateIn, MoIn) & " " & dteX & ", " &
Format(DateIn, "yyyy")
End Function
====
Then in a Form or Report control:
= DateOrdinalEnding([ADate],"mmmm")
Will display today's date as November 29th, 2001
--
Fred
Please reply only through this newsgroup.
I do not reply to direct e-mails.
Quote:
> The subject describes what i need to make access do with
> displaying the date, is there a formatting code for this?
> Or do i need to do a little code