Re: Weekly Date Calculation
- From: "Pam" <pamnospam@xxxxxxxxxxxxxxxx>
- Date: Wed, 12 Jul 2006 12:15:00 -0500
Klatuu,
Thank you for answering. The expression I listed in my first message is in
my query under StartTime criteria. Do I put the function you gave in the
same place? And do I combine them with "Between...And..."? If so, I tried
that and it returns an error message of "The expression you entered has an
invalid (dot) or ! operator or invalid parentheses" and the curser flashes
on the parenthesis before the "w".
Thanks again,
Pam
"Klatuu" <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4F46C343-242E-42D4-8D81-6B8DFA867B5C@xxxxxxxxxxxxxxxx
This function:
DateAdd("d",-6-Weekday(Date()),Date())
Actually returns a Sunday date, not a Monday.
This function will return the Monday date for the previous week:
dtmFromDate = DateAdd("d",vbMonday - DatePart("w", Date) -7, Date)
Then to get the To Date that will be the same day of the week one week
prior
to today:
dmToDate = DateAdd("d",Weekday(Date,vbMonday)-1, dtmFromDate)
"Pam" wrote:
Hi,
I have a report that returns a list of work done weekly. The expression
I
am using now is only good for looking at the report on Monday (7 days
prior). Work week is Monday thru Sunday. Is there a calculation that
will
give me the work completed and totaled from Monday to any day of that
week.
Say if report was reviewed on Tuesday and then on Thursday, it would give
totals from Monday thru Tuesday and then again from Monday thru Thursday.
Here is what I am using now:
Between DateAdd("d",-6-Weekday(Date()),Date()) And
DateAdd("d",1-Weekday(Date()),Date())
Any help is greatly appreciated!
Thanks,
Pam
.
- Follow-Ups:
- Re: Weekly Date Calculation
- From: Klatuu
- Re: Weekly Date Calculation
- References:
- Weekly Date Calculation
- From: Pam
- Weekly Date Calculation
- Prev by Date: Re: Conditional Formatting Issue
- Next by Date: Re: Referencing a control on one form from another
- Previous by thread: Weekly Date Calculation
- Next by thread: Re: Weekly Date Calculation
- Index(es):
Relevant Pages
|