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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display the Current Week Used in the Sorting/Grouping 1

Status
Not open for further replies.

Mike555

Technical User
Feb 21, 2003
1,200
US
I have a report that sorts by 'DueDate' and groups on Week. I'm trying to figure out how to display the start date & end date of the week within each 'DueDate' header.

For example: If I have 2 records with DueDates 05/11/05 and 05/12/05, their DueDate header would display something like: "Week of: 05/08/05 - 05/14/05".

So far I've tried this (unsuccessfully)...
="Week " & Min([MCDate]) & " - " & Max([MCDate])

Is this possible? If so, could someone please point me in the right direction?

Thanks.


--
Not until I became a Network Administrator did the error message "See your Network Administrator for assistance" become petrifying.
 
I use this to determine the "Monday-Friday" of the present week.



Function prevweek(ByVal MYNUMBER As Date) As Date

prevweek = IIf(WeekDay(DATE) = 2, DateAdd("d", 2 - WeekDay(DATE), DATE) - 7, DateAdd("d", 2 - WeekDay(DATE), DATE))

End Function
 
Mike, I forgot to add; I use this in the query to select the records for the week.
Code:
Between IIf(Weekday(Date())=2,DateAdd("d",2-Weekday(Date()),Date())-8,DateAdd("d",2-Weekday(Date()),Date())) And IIf(Weekday(Date())=2,DateAdd("d",2-Weekday(Date()),Date())-3,Date())

On Monday it will select the previous week m-f.
On Tues it will select Monday.
On Wed it displays Mon-Tues.
On Thurs Mon-Wed.
Friday display Mon-Thurs.
You can edit it to display the dates Sun-Sat
 
Thanks alot for that valuable info!


--
Not until I became a Network Administrator did the error message "See your Network Administrator for assistance" become petrifying.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top