Capture Sunday Date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form where user enters a date for daily timesheets they input.
This company considers their work week starting from SUNDAY to Saturday.
How could I thru code or function capture the SUNDAY date based on the day
they enter.

thanks in advance.
 
You can nest a couple date functions. DateAdd() allows you to add (or
subtract) almost any interval of dates/times. The Weekday() function returns
the number of the day of the week. For instance WeekDay(#12/18/2006#) returns
2. So, if you subtract the weekday number from the work date and then add 1,
you will get the Sunday date.
DateAdd("d",-Weekday([WorkDate])+1,[WorkDate])
 
Back
Top