[AccessD] Getting the start and end dates of the current week

Mcgillivray, Donald [ITS] donald.a.Mcgillivray at mail.sprint.com
Fri Feb 27 19:03:16 CST 2004


Christopher,

This ought to do it:

Function EndsOfWeek(datInputDate As Date, strWhichEnd As String) As Date
Dim datFirstOfWeek As Date, datLastOfWeek As Date
datFirstOfWeek = datInputDate - (Weekday(datInputDate) - 1)
datLastOfWeek = datInputDate + (7 - Weekday(datInputDate))
Select Case strWhichEnd
    Case "First"
        EndsOfWeek = datFirstOfWeek
    Case "Last"
        EndsOfWeek = datLastOfWeek
End Select
End Function

Don

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Christopher
Hawkins
Sent: Friday, February 27, 2004 3:27 PM
To: accessd at databaseadvisors.com
Subject: [AccessD] Getting the start and end dates of the current week


I need a function that will determine the start and end dates of the
current week.  I'm hacking around with some code, but I'm not producing
enything useful.  Surely I'm not the first to have this problem?

-Christopher-


-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list