Public Function DateSay(ByRef pdte As Date) As String
Dim strHold As String
strHold = Format(pdte, "dddd mmmm") & " " & NumSuffix(Day(pdte)) & " " &
Format(pdte, "yyyy")
DateSay = strHold
End Function
Public Function NumSuffix(mynum As Variant) As String
'*******************************************
'Purpose: Add suffix to a number
'coded by: raskew
'Inputs: ? NumSuffix(234)
'Output: 234th
'*******************************************
Dim n As Integer
Dim x As Integer
Dim strSuf As String
n = Right(mynum, 2)
x = n Mod 10
strSuf = Switch(n <> 11 And x = 1, "st", n <> 12 And x = 2, "nd", _
n <> 13 And x = 3, "rd", True, "th")
NumSuffix = LTrim(str(mynum)) & strSuf
End Function
To test from debug (immediate) window:
? datesay(date())
Friday March 30th 2007
HTH - Bob
Jeff Boyce wrote:
>Simon
>
>Have you looked at the Long Date format in your table/field definition?
>
>Regards
>
>Jeff Boyce
>Microsoft Office/Access MVP
>
>>I can display the date as 30th March 2007 is there a way to display
>> the day as well Friday 30th March 2006
>>
>> Thanks
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200703/1