Try this:
Private Function GetLastDayOfWeek(ByVal dt As Date) As Date
Dim firstDayOfWeek As Integer =
CInt(DateTimeFormatInfo.CurrentInfo.FirstDayOfWeek )
Dim lastDayOfweek As Integer = (firstDayOfWeek + 6) Mod 7
If lastDayOfweek < dt.DayOfWeek Then
Return dt.AddDays(lastDayOfweek - dt.DayOfWeek + 7.0)
Else
Return dt.AddDays(lastDayOfweek - dt.DayOfWeek)
End If
End Function
/claes
"csgraham74" <cs********@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Hi Guys,
I was wondering if anyone could help me find a function to get a week
ending function??
i.e. week ending on sunday
Therefore if a i was to input todays date in my function it would
output the sunday date of the same week. If anyone has a such a
function or can point me in the right direction it would be most
helpful.
Regards
CG