Capture Sunday 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.
 
G

Guest

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])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top