DatePart function

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi all,

I'm trying to do the reverse of what a datepart does. I have the week (30)
and the day of the week (2 - Monday). How do I turn this back into a date
which in this example is : July, 21 2008?

Thanks for any info
 
Mark said:
I'm trying to do the reverse of what a datepart does. I have the week (30)
and the day of the week (2 - Monday). How do I turn this back into a date
which in this example is : July, 21 2008?


Use the DateSerial function for that kind of thing.

First, you need to have a way to fugure out which year you
are talking about.

DateSerial(theyear, 1, 7*(woy-1) + dow - firstdayofyear)

where:
woy is the week of the year
dow is the day of the week
firstdayofyear is the first day of the year used by the
DatePart function.
 
Back
Top