Date Header for Week

  • Thread starter TinleyParkILGal
  • Start date
T

TinleyParkILGal

I have a report of tasks that stay on the report until the done field is
checked. Every Monday I need to print the report and I need a header that
says "PROJECTS FOR THE WEEK OF 8/4/08 to 8/8/08".

I will print the report any day of the week and if I print the report in the
middle of the week, perhaps on a Wednesday, I still would like the report to
show the 5 day span.

Examples:

I will print the report on Wed. 8/6/08
The header should show PROJECTS FOR THE WEEK OF 8/4/08 to 8/8/08

If I print the report on Thur. 8/28/08
The header should show PROJECTS FOR THE WEEK OF 8/25/08 to 8/29/08

Thanks for any help you can give me.
 
J

Jeff Boyce

It all starts with the data ... and you haven't described yours.

The "how" depends on how your data is structured (i.e., tables).

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Jeff Boyce

By the way, if you can identify the "week" of the date you print the report,
you can identify the Monday of that week. Take a look at DatePart() in
Access HELP.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
T

TinleyParkILGal

Thanks for reply Jeff. I have a task date field in my table along with task
description. The dates have an unlimited range. There is a yes/no box which
is checked yes when the task is complete.

So, on any given day of the week I will print the report at the request of
the boss and it will show all undone tasks that were ever entered and they
will be the tasks that are on the report for the current week. If I print it
today based on todays print date I would want the report to show "tasks for
the week of 8/4/08 to 8/8/08.
 
J

Jeff Boyce

Sorry, maybe I'm being dense today...

I don't see how I could tell which task should show up "on the report for
the current week"?

Then the issue of the header information... if you know todays date (i.e.,
using Date() function), you can get the day-of-the-week number (depends on
when you start counting ... ?Sunday = 1, ...). Knowing that should allow
you to determine what the date was, for example, two days earlier (today is
Wednesday).

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
T

TinleyParkILGal

Thanks Jeff,

Any time I print the report I want all tasks uncheck to show which is the
part I can handle but I cannot figure out how to get the report to a span of
dates (a week span) from the date printed. I do not know the syntax. Is it :

=Date(1) to Date (5) ), ?

All I am looking of on some of my reports is if I print a report today for
example (8/8/08) I want the report at the top to say:

Report for: 8/4/08 to 8/8/08

Which is a Monday to Friday.

Thanks and have a great weekend.
 
J

Jeff Boyce

Today's date (August 8) can be returned using Date().

The WeekDay() function returns the "day of week #" for a date, based on your
windows setup for which is the first day of the week. My PC is set up with
Sunday being day 1.

So, WeekDay(Date()) returns 6 ... today (Friday) is the 6th day of this
week.

?How many days previous to today is Monday? Looks like 4 days ... today's #
minus Monday's # = 6-2.

If I take 4 days away from today, I get Monday's date. One way to do that
would be Date() - 4, or to use the DateDiff() function.

But it won't always be Friday, so I don't always want to take away 4 days.
?! How 'bout if I take WeekDay(Date()) - 2 ?! That should cover any day of
the week! (but won't handle the situation if you're on vacation and miss a
couple weeks...).

It's looking to me like I can get Monday-of-this-week's-Date with something
like:

MondaysDate: Date() - (WeekDay(Date()) - 2)

Does this give you enough to puzzle out how to figure out Friday's date?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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