Results 1 to 3 of 3
  1. #1
    Astron2012 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    54

    Calculate last 4 weeks (Friday to Friday)

    Hi,

    I am trying to bring up data for the last 4 weeks Friday to Friday eg Friday 1st Nov to Friday 22nd Nov.

    I know that if I want to bring up results just for last Friday the formula is: Year([WeekEnding])*53+DatePart("ww",[WeekEnding])=Year(Date())*53+DatePart("ww",Date())-1 and this works.

    So I have been trying:

    Between Year([WeekEnding])*53+DatePart("ww",[WeekEnding])=Year(Date())*53+DatePart("ww",Date())-4 And Year([WeekEnding])*53+DatePart("ww",[WeekEnding])=Year(Date())*53+DatePart("ww",Date())-1



    but this doesn't bring up any data when it should.

    Any ideas what I'm doing wrong?

    Any help is appreciated

    FYI... Year([WeekEnding])*53+DatePart("ww",[WeekEnding])=Year(Date())*53+DatePart("ww",Date())-4 Brings up the results for 4 Fridays ago fine too

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Try:

    Year([WeekEnding])*53+DatePart("ww",[WeekEnding]) BETWEEN Year(Date())*53+DatePart("ww",Date())-4 AND Year(Date())*53+DatePart("ww",Date())-1
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Astron2012 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    54
    Yes it works.... thanks so much!!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Field to display last Friday's date by default
    By lsmcal1984 in forum Forms
    Replies: 11
    Last Post: 10-07-2013, 12:05 PM
  2. Replies: 9
    Last Post: 04-26-2013, 12:12 PM
  3. Select the First friday after a date
    By lucasjkr in forum Queries
    Replies: 1
    Last Post: 11-13-2012, 03:07 PM
  4. Replies: 14
    Last Post: 06-20-2012, 08:54 AM
  5. Getting the last and the next Friday
    By bonecone in forum Programming
    Replies: 9
    Last Post: 05-10-2012, 02:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums