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
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
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.
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)'.
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.
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
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.
Duration (#-field) for each week\weekly
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.
I figured it out & got m results. Thanks!