Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Header to show first day of the Week 2

Status
Not open for further replies.

Geekette

MIS
Jun 5, 1999
27
US
I am designing a report that will break on a date field [posted], with grouping on the Week level. I would like the header for that date to show the first day of whatever week the date fields are in.
For example if [posted] has values of 9/11/00, 9/13/00, and 9/19/00, I want the [posted] headers to read
"Week of 9/10/00" : the details for that week would include 9/11/00 and 9/13/00;
"Week of 9/17/00: the detail for that week would include 9/19/00.
Any suggestions?
[sig][/sig]
 
Geekette,

Do You VBA? If so, just check the "WeekDay" function in VBA.


? Datevalue(Month(Now) & "/" & Day(Now()) - Weekday(Now()) + 2 & "/" & Year(Now()))
9/18/00

is from the "immediate" window, and gives the date for Monday of the current week. You (obviously?) replace Now with the date of your choice from the recordsource.

[sig]<p>MichaelRed<br><a href=mailto:mred@duvallgroup.com>mred@duvallgroup.com</a><br>There is never time to do it right but there is always time to do it over[/sig]
 
thanx a bunch!!! i had *totally* forgotten the weekday function. i was getting all involved in the system vs. united states settings for dates - way off course! [sig][/sig]
 
I had exactly the same problem, and finally solved it by putting a label &quot;Week of&quot; followed by a textbox, both in the date header (I also grouped by date on week interval).
The text box data source was set to:
=([date]-(Weekday([date]))+2)
Where [Date] was one of the fields listed in the detail section.


 
I use
=DateAdd(&quot;d&quot;,2-Weekday(Date()),Date())
for the Monday of the current week and
=DateAdd(&quot;d&quot;,2-Weekday(Date()),Date()+4)
for the Friday.
Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top