(Msg. 1) Posted: Wed Sep 30, 2009 8:05 pm
Post subject: Autofill Day of the Week Archived from groups: microsoft>public>access>gettingstarted (more info?)
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
(Msg. 2) Posted: Thu Oct 01, 2009 1:53 am
Post subject: RE: Autofill Day of the Week [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
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
>
(Msg. 3) Posted: Thu Oct 01, 2009 9:18 am
Post subject: RE: Autofill Day of the Week [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
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
>
(Msg. 4) Posted: Thu Oct 01, 2009 10:57 am
Post subject: RE: Autofill Day of the Week [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
> 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,
I can't scare up any info in Help about that function.
Is it in the special "Halloween.dll"
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
(Msg. 5) Posted: Thu Oct 01, 2009 11:07 am
Post subject: RE: Autofill Day of the Week [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Now that is funny.
Name should be weekdayname
Totally amazing because I never make mistrakes.
--
Dave Hargis, Microsoft Access MVP
"Steve Sanford" wrote:
>
>
> > 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,
>
> I can't scare up any info in Help about that function.
>
> Is it in the special "Halloween.dll" >
>
> --
> Steve S
> --------------------------------
> "Veni, Vidi, Velcro"
> (I came; I saw; I stuck around.)
(Msg. 6) Posted: Thu Oct 08, 2009 10:41 am
Post subject: RE: Autofill Day of the Week [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
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
>
(Msg. 7) Posted: Thu Oct 08, 2009 11:22 am
Post subject: RE: Autofill Day of the Week [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
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
> >
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum