Carnage
04-06-2000, 06:41 AM
How can I convert a 2-digit number representing the week of the current year to the format "yyyy/mm/dd"?
|
View Full Version : Converting week number to date Carnage 04-06-2000, 06:41 AM How can I convert a 2-digit number representing the week of the current year to the format "yyyy/mm/dd"? Travis 04-06-2000, 09:55 PM Try this Public Function ConvertWeekToDate(dbWeek as Double) as Variant Dim dDate as Date dDate = dateadd("w",(7*dbWeek)-1,"1/" & datepart("yyyy",date)) ConvertWeekToDate = Format(dDate,"yyyy/mm/dd") end function maxxaviersteel 08-09-2007, 06:00 AM I ran this, but got a compile error. Should I copy verbatem or with changes? Also, is there a way of checking the year if a user needed to pull date from the year before? |