Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 13th, 2005, 12:36 PM
S. van Beek
Guest
 
Posts: n/a
Default How to display (print) the day of the week for a date field



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


  #2  
Old November 13th, 2005, 12:36 PM
fredg
Guest
 
Posts: n/a
Default 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.
  #3  
Old November 13th, 2005, 12:36 PM
Chuck Grimsby
Guest
 
Posts: n/a
Default 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]

  #4  
Old November 13th, 2005, 12:37 PM
Mike Preston
Guest
 
Posts: n/a
Default 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

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles