Translate Tuesday to WeekdayNumber?

  • Thread starter Thread starter Henro
  • Start date Start date
H

Henro

How can I translate the name of the day (e.g. Tuesday) to a weekdaynumber
(e.g. 3)?
Weekday and WeekdayName seem to do the opposite :-(

TIA Henro
 
I don't believe there's anything built into Access that will do that
translation, so you'll probably have to write your own function to do it.

Why, though, do you need this capability? If you know the complete date,
Weekday([TheDate]) will give you the weekday number.
 
I have a list of engineers. They have one day off each week, this is a fixed
day (in my case Tuesday)
This day is noted in the table with it's full name (e.g. Tuesday)
I have built some kind of calendar in Access and I want the field
DayDescription to be filled automatically with "DayOff" if that particular
day is the Day off for that Engineer. So in human language:

If Engineer is Henro and Day in Calendar is Tuesday then Fill DayDescription
with "DayOff" and that check has to be done on every day in the calendar
(400 days starting from 1-1-2004)


Henro





Douglas J. Steele said:
I don't believe there's anything built into Access that will do that
translation, so you'll probably have to write your own function to do it.

Why, though, do you need this capability? If you know the complete date,
Weekday([TheDate]) will give you the weekday number.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Henro said:
How can I translate the name of the day (e.g. Tuesday) to a weekdaynumber
(e.g. 3)?
Weekday and WeekdayName seem to do the opposite :-(

TIA Henro
 
You could loop through the first week of the calendar, comparing
Format([CalendarDay], "dddd") to the stored DayOff. Once you've identified
the date of the first day off, subsequent ones would be that date a week
later (i.e. DateAdd("d", 7, [CalendarDay]) or DateAdd("ww", 1,
[CalendarDay])). Or have I misinterpretted what you're trying to do?

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Henro said:
I have a list of engineers. They have one day off each week, this is a fixed
day (in my case Tuesday)
This day is noted in the table with it's full name (e.g. Tuesday)
I have built some kind of calendar in Access and I want the field
DayDescription to be filled automatically with "DayOff" if that particular
day is the Day off for that Engineer. So in human language:

If Engineer is Henro and Day in Calendar is Tuesday then Fill DayDescription
with "DayOff" and that check has to be done on every day in the calendar
(400 days starting from 1-1-2004)


Henro





Douglas J. Steele said:
I don't believe there's anything built into Access that will do that
translation, so you'll probably have to write your own function to do it.

Why, though, do you need this capability? If you know the complete date,
Weekday([TheDate]) will give you the weekday number.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Henro said:
How can I translate the name of the day (e.g. Tuesday) to a weekdaynumber
(e.g. 3)?
Weekday and WeekdayName seem to do the opposite :-(

TIA Henro
 
Back
Top