Connecting Tech Pros Worldwide Help | Site Map

How to display (print) the day of the week for a date field

S. van Beek
Guest
 
Posts: n/a
#1: Nov 13 '05


Dear reader,



I need to know which day of the week belongs to a date field.



30 June 2005 is Thursday



There is a function Datepart("ww";[Fieldname])



But how can I display the day of the week for a datefield.



Datepart("day";([Fieldname]) comes back with a error.



Thanks for any help.



Kind regards,

Simon van Beek


fredg
Guest
 
Posts: n/a
#2: Nov 13 '05

re: How to display (print) the day of the week for a date field


On Thu, 30 Jun 2005 22:54:08 +0200, S. van Beek wrote:
[color=blue]
> Dear reader,
>
> I need to know which day of the week belongs to a date field.
>
> 30 June 2005 is Thursday
>
> There is a function Datepart("ww";[Fieldname])
>
> But how can I display the day of the week for a datefield.
>
> Datepart("day";([Fieldname]) comes back with a error.
>
> Thanks for any help.
>
> Kind regards,
>
> Simon van Beek[/color]

Not clear what you want.
Are you wanting to print the word "Thursday"?

=Format([DateField],"mmmm")

Are you wanting to print a 5 (if the date is a Thursday, and the first
day of the week is Sunday).?

=DatePart("w",[DateField])

This information is all available in VBA Help.


--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Chuck Grimsby
Guest
 
Posts: n/a
#3: Nov 13 '05

re: How to display (print) the day of the week for a date field



Format$([Fieldname],"ddd")

or

Format$([Fieldname],"dddd")

or

Format$(Weekday([Fieldname]),"dddd")

......

And a few thousand other ways.

S. van Beek wrote:[color=blue]
> I need to know which day of the week belongs to a date field.
> 30 June 2005 is Thursday
> There is a function Datepart("ww";[Fieldname])
> But how can I display the day of the week for a datefield.
> Datepart("day";([Fieldname]) comes back with a error.[/color]

Mike Preston
Guest
 
Posts: n/a
#4: Nov 13 '05

re: How to display (print) the day of the week for a date field


On Thu, 30 Jun 2005 22:54:08 +0200, "S. van Beek" <S.v.Beek@HCCnet.nl>
wrote:
[color=blue]
>Dear reader,
>
>I need to know which day of the week belongs to a date field.
>
>30 June 2005 is Thursday
>
>There is a function Datepart("ww";[Fieldname])
>
>But how can I display the day of the week for a datefield.
>
>Datepart("day";([Fieldname]) comes back with a error.[/color]

Try Datepart("w",[Fieldname])

This will return a number from 1 to 7. If that number is 1, it is
Sunday, 2, Monday, etc.

See help on "Datepart"

mike

Closed Thread