Beginning and ending dates of a specified week 
Author Message
 Beginning and ending dates of a specified week

I'm looking for as simple an expression/function as possible to determine
the week start date and end date for a given date.
E.G.    WeekStart(2/6/2002) = 2/3/2002 'The previous sunday
            WeekEnd(2/6/2002) = 2/9/2002 'The following saturday

I've been able to do it but it seems like a lot of code for something that
appears to be simple.

Thanks

Steve



Sun, 25 Jul 2004 04:48:34 GMT  
 Beginning and ending dates of a specified week
Have you tried?

WeekStart: DateAdd("d",1-Weekday(Date()),Date)
WeekEnd: DateAdd("d",7-Weekday(Date()),Date())

These should work as long as Sunday is set as the first day of the week in your
system settings.

Quote:

> I'm looking for as simple an expression/function as possible to determine
> the week start date and end date for a given date.
> E.G.    WeekStart(2/6/2002) = 2/3/2002 'The previous sunday
>             WeekEnd(2/6/2002) = 2/9/2002 'The following saturday

> I've been able to do it but it seems like a lot of code for something that
> appears to be simple.

> Thanks

> Steve



Sun, 25 Jul 2004 05:28:55 GMT  
 Beginning and ending dates of a specified week
Simple, elegant, just what I needed. Thanks John!!!


Sun, 25 Jul 2004 06:22:09 GMT  
 Beginning and ending dates of a specified week
You are welcome
Quote:

> Simple, elegant, just what I needed. Thanks John!!!



Tue, 27 Jul 2004 02:40:36 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Printing Gantt-chart with defined begin and end dates

2. Need VBA to calc week-ending date

3. Calculate week ending date .......

4. Date / Same date or first day of week

5. Use of Begin/End trans scope

6. Please explain the BEGIN CALLOUT / END CALLOUT statements

7. Sprite.Begin and Sprite.End

8. Saving a text file without quotes at the beginning and end of the file

9. week ending

10. REQ help: Calculating elapsed time from date/time began from Date/time ended. Many THANKS!

11. Calculating elapsed time from date/time began from Date/time ended. Many THANKS!

12. Multiple Dates by choosing Start and End Date

 

 
Powered by phpBB® Forum Software