Re: Weekly Date Calculation

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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





.



Relevant Pages

  • Re: Help ! Getting overwhelmed ....................
    ... I just posted my first message to this group today - just ... >with swen-aware filter) ... >Report the emails to the appropriate abuse-department. ...
    (microsoft.public.win2000.security)
  • Re: UI updating issue when several windows are open
    ... >For some reason though, I do not see any reaction to my first message, ... >prior to the call. ... It is as though Java/Swing is not interested in ...
    (comp.lang.java.gui)
  • Re: Crosstab counting
    ... clock forward to test it. ... Now as stated in the first message is the group, ... What I have to do with these numbers is compile them into a report broken ...
    (microsoft.public.access.queries)
  • Re: [BUG?] OOM with large cache....(x86_64, 2.6.24-rc3-git1, nohz)
    ... the scheduler is to add them immediately to the cfs-debug-info.sh script ... and we still havent made it easy to report the right kind of information ... have been provided in the first message (by running a single, ... specifically needed NR_ANON_PAGES for an oom-killer problem ...
    (Linux-Kernel)
  • Re: Me.Command0.Visible = CurrentUser = "ManagerUserName"
    ... I opened the report properties and under ... > Private Sub Report_Open ... Option3 control is on the form? ... Your first message in this thread started in the ...
    (microsoft.public.access.forms)