Date

F

Fred

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.
 
T

tina

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
 
D

Douglas J. Steele

tina said:
Weekday(Date)

If you want to return the day's name, you can use

Choose(Weekday(Date), "Sunday", "Monday", "Tuesday", "Wednsday",
"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>)
 
T

tina

you're right, Doug, on both counts! <g>


Douglas J. Steele said:
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>)
 
Top