How to Handle "Week Ending" date in Access

I just began using Microsoft Access and am creating a database to handle Weekly Activity reporting. For example, during the week of 3/16/15 through 3/20/15, I sent 29 emails, received 12 emails, attended 6 meetings, etc.

 I am trying to figure out a way to handle the "Week Ending" date. For each weekly activity report, there must be a "Week Ending" date - which must be the Friday of the current week. Any suggestions on how to go about doing so?

 I have a Users table that holds the username, network id, and password. I also have a Weekly table that holds each element I want shown on my Weekly Activity report (e.g. emails sent, emails received, meetings attended, etc.).
kaleelee21Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gustav BrockCIOCommented:
You can use this generic function:
Public Function DateNextWeekday( _
  ByVal datDate As Date, _
  Optional ByVal bytWeekday As Byte = vbMonday) _
  As Date

' Returns the date of the next weekday, as spelled in vbXxxxday, following datDate.
' 2000-09-06. Cactus Data ApS.
    
  ' No special error handling.
  On Error Resume Next
  
  DateNextWeekday = DateAdd("d", 7 - (Weekday(datDate, bytWeekday) - 1), datDate)
    
End Function

Open in new window

/gustav
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
IrogSintaCommented:
To get the week ending as Friday for each date in your record, use something like this.
= [NameOfDateField] + (7 - Weekday([NameOfDateField], vbSaturday))
Or this:
= [NameOfDateField] + (7 - Weekday([NameOfDateField], 7)

DT               WeekEnding
3/18/15      3/20/15
3/19/15      3/20/15
3/20/15      3/20/15
3/21/15      3/27/15
3/22/15      3/27/15


Ron
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Legacy OS

From novice to tech pro — start learning today.