Results 1 to 9 of 9
  1. #1
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476

    Displaying weekly figures?

    I have a databsed ated back to 3/2011 with daily entries. I would like to know if/how to create a query showing just the weekly (Sun - Sat) figures/sums starting from 3/2011



    Thanks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Calculate Sunday date for the week the daily entry date falls in with:
    [DailyDate]-Weekday([DailyDate])+1

    Then use this calculated field in a GROUP BY totals query. Example:
    SELECT Sum(Table1.Weight) AS SumOfWeight, [DailyDate]-Weekday([DailyDate])+1 AS Su
    FROM Table1
    GROUP BY [DailyDate]-Weekday([DailyDate])+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
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    Table name is- Music Log:
    Date fild name is- TDate

    I Trid
    SELECT Sum(Music Log:.Weight) AS SumOfWeight, [TDate]-Weekday([TDate])+1 AS Su
    FROM MusicLog:
    GROUP BY [TDate]-Weekday([TDate])+1;

    I received this-
    Syntax error (missing Operator) in query expression 'Sum(MusicLog:.Weight)'.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Is Weight a field in your table? The table name has a space and colon? Advise against punctuation (underscore is exception), special characters, spaces in names. Must enclose in [] if any of those occur or if using reserved word as name.
    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.

  5. #5
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    Weigh is NOTa field in mytable

    Itried:
    SELECT Sum([Music Log:] [TDate]-Weekday([TDate])+1 AS Su
    FROM [Music Log:]
    GROUP BY [TDate]-Weekday([TDate])+1

    no luck

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    So what field in your table needs to be summed? Put it in place of Weight.
    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.

  7. #7
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    Duration (#-field) for each week\weekly

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Don't understand. What is Duration (#-field)?
    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.

  9. #9
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    I figured it out & got m results. Thanks!

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

Similar Threads

  1. Weekly Totals
    By tcheck in forum Access
    Replies: 4
    Last Post: 09-27-2011, 09:35 AM
  2. difference between weekly sales
    By Fabdav in forum Access
    Replies: 1
    Last Post: 09-11-2011, 06:57 PM
  3. Weekly calculation query?
    By katie_88 in forum Queries
    Replies: 1
    Last Post: 07-13-2010, 10:54 AM
  4. Replies: 4
    Last Post: 03-31-2010, 03:41 PM
  5. weekly total
    By nkuebelbeck in forum Queries
    Replies: 2
    Last Post: 03-24-2010, 02:59 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