Add a day of week field to table

YNWA

Registered User.
Local time
Today, 18:57
Joined
Jun 2, 2009
Messages
905
Hi, I have a table with a date field. I want to add a Day of week field to that table.

Is it possible to do so in an update query or anything like that? So the day of the week updates based on the date?

ANy ideas?

Thanks
Will
 
Noooooooooooooooooooooooo

Day of week is a calculated value and should NEVER be stored in a table.
Instead simply calculate it from the date on the fly in a query !
 
How do I do that?
 
Do not add a day of the week field. It is a derived value that should be calculated as required using the WeekdayName and Weekday functions.

WeekdayName(Weekday(yourdatefield))
 
Erm GAH, what is wrong with
format(date(), "DDDD")

or
format(date(), "DDD")

which is way more flexible and intuative to use IMHO?
 
Of course. Doh. :o
Error #: C2H50H
 
Erm GAH, what is wrong with
format(date(), "DDDD")

or
format(date(), "DDD")

which is way more flexible and intuative to use IMHO?

I'm confused.

Do I create a query? Do I put this code ^^^ in the Format part of the table field properties?

How do I go about it?
 
*

You make a query and make one of the fields be "dayofweek: format([Yourdatefield],"DDDD")"
 
Don't put it in the table. It is a derived value.

Anywhere you need the day of the week from the date field in the table, such as in a query or a control on a form or report, use the expression.

In the query designer field cell:
TheDay: Format([yourdatefield], "dddd")

In the Control Source property of a control:
= Format([yourdatefield], "dddd")
 

Users who are viewing this thread

Back
Top Bottom