Dispaying the Day in the Date

S

Simon

I can display the date as 30th March 2007 is there a way to display
the day as well Friday 30th March 2006


Thanks
 
J

Jeff Boyce

Simon

Have you looked at the Long Date format in your table/field definition?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
R

raskew via AccessMonster.com

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

same day, different year 6
Date question 4
Excel Progress Bar Showing Progress of Month 0
Formula IF 1
Months 4
Day/Date formula 11
International date formats 2
Date/Day VBA Calculation 4

Top