"scorpion53061" <sc************@nospamhereeveryahoo.com> wrote in message
news:10*************@corp.supernews.com...
I have a work assignment that
gives me a date
and I want to find all other dates in that week.
Here are two functions that may be of help, given a date, to return the
first day of the week and the last day of the week:
Function FDOW(pdatADay As Date) As Date
If Weekday(pdatADay) = 1 Then
FDOW = pdatADay
Else
FDOW = DateAdd("d", pdatADay, -Weekday(pdatADay) + 1)
End If
End Function
Function LDOW(pdatADay As Date) As Date
If Weekday(pdatADay) = 7 Then
LDOW = pdatADay
Else
LDOW = DateAdd("d", pdatADay, 7 - Weekday(pdatADay))
End If
End Function