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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|