Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / March 2007

Tip: Looking for answers? Try searching our database.

Dispaying the Day in the Date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Simon - 30 Mar 2007 21:05 GMT
I can display the date as 30th March 2007  is there a way to display
the day as well Friday 30th March 2006

Thanks
Rick B - 30 Mar 2007 21:12 GMT
To display a day...

=Format([YourDateFieldNameHere],"dddd")

Signature

Rick B

>I can display the date as 30th March 2007  is there a way to display
> the day as well Friday 30th March 2006
>
> Thanks
Jeff Boyce - 31 Mar 2007 00:57 GMT
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
raskew - 31 Mar 2007 02:50 GMT
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

>Simon
>
[quoted text clipped - 9 lines]
>>
>> Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.