A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Autofill Day of the Week



 
 
Thread Tools Display Modes
  #1  
Old October 1st, 2009, 04:05 AM posted to microsoft.public.access.gettingstarted
Bill
external usenet poster
 
Posts: 1,009
Default Autofill Day of the Week

How can I create a table with two fields in it. The first field is named
“ddate” and set for “Short Date” as the data type. This will be the primary
key also. So once I enter the date i.e. 09/30/2009 into the “ddate” field.
The next field named “dayoftheweek” and set for “Text” as the data type. I
want this field to autofill with the day of the week i.e. Wednesday. I have
read other posts and tried entering in the second field Format section this
=Format ([ddate],”dddd”) but when I save the table the text I entered
changes. It changes to “=For”m”at([“dd”ate],dddd). Does anyone know where I
went wrong. This is my first Access project so I am in need of guidance.
Thanks,
Bill

  #2  
Old October 1st, 2009, 09:53 AM posted to microsoft.public.access.gettingstarted
Wayne-I-M
external usenet poster
 
Posts: 3,674
Default Autofill Day of the Week

Hi Bill

You "could" add the name of the day to a field in a table - if you really
wanted - using an update query
But godd idea is not to.
You can add the day to a query, form or report using the
Format([datefield],"dddd")
at any time you want so what is the point is storing this. It's just extra
data that can be created whenever you want.

Also if you add the name of the day a field and then (for some strange
reason) change the date field you would then need to update the name field
using your update query.

best bet is not to store it


--
Wayne
Manchester, England.



"Bill" wrote:

How can I create a table with two fields in it. The first field is named
“ddate” and set for “Short Date” as the data type. This will be the primary
key also. So once I enter the date i.e. 09/30/2009 into the “ddate” field.
The next field named “dayoftheweek” and set for “Text” as the data type. I
want this field to autofill with the day of the week i.e. Wednesday. I have
read other posts and tried entering in the second field Format section this
=Format ([ddate],”dddd”) but when I save the table the text I entered
changes. It changes to “=For”m”at([“dd”ate],dddd). Does anyone know where I
went wrong. This is my first Access project so I am in need of guidance.
Thanks,
Bill

  #3  
Old October 1st, 2009, 05:18 PM posted to microsoft.public.access.gettingstarted
Klatuu
external usenet poster
 
Posts: 7,074
Default Autofill Day of the Week

As Wayne said, you should not do that. Carrying calculated data in a table
violates one of the basic rules of database normalization. In this case it
also means you are carrying data in the table that would have no purpose
other than to take up space.

Here is another expression you can use to present the day of the week to
users in forms or reports when needed:

eekdayname(weekday(date))
--
Dave Hargis, Microsoft Access MVP


"Bill" wrote:

How can I create a table with two fields in it. The first field is named
“ddate” and set for “Short Date” as the data type. This will be the primary
key also. So once I enter the date i.e. 09/30/2009 into the “ddate” field.
The next field named “dayoftheweek” and set for “Text” as the data type. I
want this field to autofill with the day of the week i.e. Wednesday. I have
read other posts and tried entering in the second field Format section this
=Format ([ddate],”dddd”) but when I save the table the text I entered
changes. It changes to “=For”m”at([“dd”ate],dddd). Does anyone know where I
went wrong. This is my first Access project so I am in need of guidance.
Thanks,
Bill

  #4  
Old October 8th, 2009, 06:41 PM posted to microsoft.public.access.gettingstarted
Bill
external usenet poster
 
Posts: 1,009
Default Autofill Day of the Week

I want to thanks everyone for the help. Sorry it took me so long to reply
back, but time didnot allow it till now. Anyway like I said I'm new to Access
so I had to rethink my table structure. I will be posting again with more
questions, I hope you can help me then.
Thanks,
Bill

"Bill" wrote:

How can I create a table with two fields in it. The first field is named
“ddate” and set for “Short Date” as the data type. This will be the primary
key also. So once I enter the date i.e. 09/30/2009 into the “ddate” field.
The next field named “dayoftheweek” and set for “Text” as the data type. I
want this field to autofill with the day of the week i.e. Wednesday. I have
read other posts and tried entering in the second field Format section this
=Format ([ddate],”dddd”) but when I save the table the text I entered
changes. It changes to “=For”m”at([“dd”ate],dddd). Does anyone know where I
went wrong. This is my first Access project so I am in need of guidance.
Thanks,
Bill

  #5  
Old October 8th, 2009, 07:22 PM posted to microsoft.public.access.gettingstarted
Klatuu
external usenet poster
 
Posts: 7,074
Default Autofill Day of the Week

Never be shy about asking questions in these groups. It is about the best
resource there is for qetting specific answers to questions as well as
guidance on design and best practices.
--
Dave Hargis, Microsoft Access MVP


"Bill" wrote:

I want to thanks everyone for the help. Sorry it took me so long to reply
back, but time didnot allow it till now. Anyway like I said I'm new to Access
so I had to rethink my table structure. I will be posting again with more
questions, I hope you can help me then.
Thanks,
Bill

"Bill" wrote:

How can I create a table with two fields in it. The first field is named
“ddate” and set for “Short Date” as the data type. This will be the primary
key also. So once I enter the date i.e. 09/30/2009 into the “ddate” field.
The next field named “dayoftheweek” and set for “Text” as the data type. I
want this field to autofill with the day of the week i.e. Wednesday. I have
read other posts and tried entering in the second field Format section this
=Format ([ddate],”dddd”) but when I save the table the text I entered
changes. It changes to “=For”m”at([“dd”ate],dddd). Does anyone know where I
went wrong. This is my first Access project so I am in need of guidance.
Thanks,
Bill

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.