dik mus wrote:
Hi,
I connect to a database that only stores the year and weeknumber. But
i need the date of the corresponding monday.
This could be more difficult as one expect because the weekumbers
might change from country to country.
(I am looking for a dutch solution.)
Thanks, dik
this is a shell of a function, but should point you in the right
direction
Function GetMondayOfWeek (byval intYear as integer, byval intWeek as
integer) as date
dim dtTemp as date
'create a date for the first of the given year
dtTemp=dateseri al(intYear,1,1)
'add the given number of weeks to it
dtTemp = dateadd("w",int Week,dtTemp)
'increment by days until you hit a Monday
do until weekday(dtTemp) =vbMonday
dtTemp=dateadd( "d",1,dtTem p)
loop
'return the date that is the Monday of the week.
GetMondayOfWeek =dttemp
end function
Check the syntax and all that - This is totally off the top of my head.