showing days of the week from the date

T

Twb

I would like to show the day of the week based of the date e.g. 27th April
2010 - Tuesday, is this possible? please help.

Many thanks
 
N

Nigel

If the date is displayed on a form, select the properties of the control and
change the format to dddd.
 
D

Dirk Goldgar

Twb said:
I would like to show the day of the week based of the date e.g. 27th April
2010 - Tuesday, is this possible? please help.


In VBA code or a calculated field in a query, you can use the Format
function:

?Format(Date, "mmmm d, yyyy - dddd")
April 27, 2010 - Tuesday

In a text box, you can use a similar Format property:

mmmm d, yyyy - dddd

Access will probably transform that to this:

mmmm d", "yyyy - dddd

but it will still work.
 
J

John W. Vinson

I would like to show the day of the week based of the date e.g. 27th April
2010 - Tuesday, is this possible? please help.

Many thanks

Sure. You can use a Format for the date including the day name. For instance
you can use a textbox on a form with a control source

=Date()

or bound to a date/time field in your table. To get almost the exact
appearance you describe (without the 'th' which will take some VBA code) set
the textbox's Format property to

"dd mmmm yyyy \- dddd"

The dd format option gives the numeric day; ddd gives the three letter day
abbreviation (Tue), dddd the full day name (Tuesday).

I'm pretty sure you can find some code for the ordinal numbers (1st, 2nd,
etc.) at http://www.mvps.org/access - search for "ordinal".
 
T

Twb

thanks

Dirk Goldgar said:
In VBA code or a calculated field in a query, you can use the Format
function:

?Format(Date, "mmmm d, yyyy - dddd")
April 27, 2010 - Tuesday

In a text box, you can use a similar Format property:

mmmm d, yyyy - dddd

Access will probably transform that to this:

mmmm d", "yyyy - dddd

but it will still work.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)
 
T

Twb

Thanks

John W. Vinson said:
Sure. You can use a Format for the date including the day name. For instance
you can use a textbox on a form with a control source

=Date()

or bound to a date/time field in your table. To get almost the exact
appearance you describe (without the 'th' which will take some VBA code) set
the textbox's Format property to

"dd mmmm yyyy \- dddd"

The dd format option gives the numeric day; ddd gives the three letter day
abbreviation (Tue), dddd the full day name (Tuesday).

I'm pretty sure you can find some code for the ordinal numbers (1st, 2nd,
etc.) at http://www.mvps.org/access - search for "ordinal".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top