Date conversion in reverse...

  • Thread starter Thread starter dforbes1
  • Start date Start date
D

dforbes1

I need to figure out how to convert a weeknum, day of week("dddd") an
year to a date(mm/dd/yyyy).

ie
Weeknum = 44
Day = Saturday
Year = 2003
answer = 11/1/2003

Any idea on the formula needed?

Thanks
 
I need to figure out how to convert a weeknum, day of week("dddd") and
year to a date(mm/dd/yyyy).

ie
Weeknum = 44
Day = Saturday
Year = 2003
answer = 11/1/2003

Any idea on the formula needed?

You might try the following (watch line wrap, it's all on one line:

DateAdd("ww",[WeekValue]-1,DateSerial([YearValue],1,1))+([DayOfWeekValue]-Weekda
y(DateAdd("ww",[WeekValue]-1,DateSerial([YearValue],1,1)),vbSunday))

From the debug window (again, watch line wrap):

?
DateAdd("ww",43,DateSerial(2003,1,1))+(7-Weekday(DateAdd("ww",43,DateSerial(2003
,1,1)),vbSunday))
11/1/2003

I have not tested this thoroughly, so you might want to see how this works on a
few values.
 
Back
Top