Results 1 to 3 of 3

Thread: Week to Date

  1. #1
    Join Date
    Jun 2008
    Location
    Leyland in NW England, UK
    Posts
    19

    Question Unanswered: Week to Date

    Am trying to summarize an integer field for week to date. Only trouble is week runs Friday to Thursday - so can't use WeekToDateFromSun.

    Can anyone help me out?

  2. #2
    Join Date
    Oct 2005
    Posts
    178
    Introduce an integer variable to subtract from todays date.
    You can use an if statement using the function DayOfWeek.
    Subtract incrementing number from today's date and if the resulting WeekOkDay is 6 then that's Friday date from today. use that as fromdate for your parameter.

  3. #3
    Join Date
    Jun 2008
    Location
    Leyland in NW England, UK
    Posts
    19

    Thumbs up Week To Date

    Cheers,
    Ended up using following code:

    1. datadate - (DatePart ("w",datadate,CrFriday))

    2. {TblRpt_CommercialSummary.date} >= (datadate - (DatePart ("w",datadate,CrFriday)))+1 and
    {TblRpt_CommercialSummary.date} <= datadate - (DatePart ("w",datadate,CrFriday))+7

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •