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 / Queries / May 2005

Tip: Looking for answers? Try searching our database.

Date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fred - 21 May 2005 19:28 GMT
Is there a way to determine what day a date is from a Date() so I can use it
in a formula?
Like 5/21/2005 is a Saturday and 5/22/2005 is a Sunday.  I noticed that the
Calendar in the form has a selection for what day to display first.  I would
imagine there must be away since the calendar knows.
tina - 21 May 2005 21:28 GMT
Weekday(Date)

the above will give you the day of the week as a number; default setting is
Sunday = 1. if you want to return the day's name, you can use

Choose(Weekday(Date), "Sunday", "Monday", "Tuesday", "Wednsday", "Thursday",
"Friday", "Saturday")

note, the above should all be on one line. btw, you can change the first day
of the week from Sunday to any other day if you want. see the Weekday
Function topic in Help.

hth

> Is there a way to determine what day a date is from a Date() so I can use it
> in a formula?
> Like 5/21/2005 is a Saturday and 5/22/2005 is a Sunday.  I noticed that the
> Calendar in the form has a selection for what day to display first.  I would
> imagine there must be away since the calendar knows.
Douglas J. Steele - 21 May 2005 22:59 GMT
> Weekday(Date)
>
[quoted text clipped - 3 lines]
> "Thursday",
> "Friday", "Saturday")

Or, more simply, Format(Date, "ddd") or Format(Date, "dddd")

This also has the advantage (I believe) that it will display the date in the
user's language (and will spell Wednesday correctly! <g>)

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

tina - 22 May 2005 03:17 GMT
you're right, Doug, on both counts!  <g>

> > Weekday(Date)
> >
[quoted text clipped - 8 lines]
> This also has the advantage (I believe) that it will display the date in the
> user's language (and will spell Wednesday correctly! <g>)
 
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.