Access question

E

eruch

how can i concert a field of dates to a field of days of
week? what syntax is to be used? where is it t be typed?
eg, in design view? please state one or two examples in
layman's terms. thank yo

eruch
 
J

John Nurick

Hi Eruch,

It's very seldom necessary to store derived data such as this in a
table. Usually it's best to create a query that calculates the weekdays
as and when needed.

Using the query design grid, type something like this in the "Field"
cell where you want the day of the week to appear:

DayOfWeek: WeekdayName(Weekday([XXX],vbSunday),False,vbSunday)

Use the actual name of your date field in place of XXX. If you want Mon,
Tue... instead of Monday, Tuesday..., change the False to True.
 
G

Guest

john, thank you. i was surprised to find someone to help so
quickly. i have several questions. 1) in my query, should
i pick the date column? and then make up a title for the
next column? and in this field i think i ought to say
DayOfWeek:
WeekdayName(Monday([Mon],vbSunday),False,vbSunday)
i think im wrong in several places. please help again.
and how can i respond in newsgroup?

eruch
-----Original Message-----
Hi Eruch,

It's very seldom necessary to store derived data such as this in a
table. Usually it's best to create a query that calculates the weekdays
as and when needed.

Using the query design grid, type something like this in the "Field"
cell where you want the day of the week to appear:

DayOfWeek: WeekdayName(Weekday([XXX],vbSunday),False,vbSunday)

Use the actual name of your date field in place of XXX. If you want Mon,
Tue... instead of Monday, Tuesday..., change the False to True.
how can i concert a field of dates to a field of days of
week? what syntax is to be used? where is it t be typed?
eg, in design view? please state one or two examples in
layman's terms. thank yo

eruch

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 
J

John Nurick

john, thank you. i was surprised to find someone to help so
quickly. i have several questions. 1) in my query, should
i pick the date column? and then make up a title for the
next column? and in this field i think i ought to say
DayOfWeek:
WeekdayName(Monday([Mon],vbSunday),False,vbSunday)
i think im wrong in several places.

See my response to your question (subject "DATES TO DAYS-OF-WEEK".
and how can i respond in newsgroup?

That is what you have done. The main reason for the request is so other
people can see and comment on or learn from the questions and answers,
which couldn't happen if it was done by email.

eruch
-----Original Message-----
Hi Eruch,

It's very seldom necessary to store derived data such as this in a
table. Usually it's best to create a query that calculates the weekdays
as and when needed.

Using the query design grid, type something like this in the "Field"
cell where you want the day of the week to appear:

DayOfWeek: WeekdayName(Weekday([XXX],vbSunday),False,vbSunday)

Use the actual name of your date field in place of XXX. If you want Mon,
Tue... instead of Monday, Tuesday..., change the False to True.
 

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