Results 1 to 4 of 4
  1. #1
    losingmymind is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    18

    Count number of occurences by day of week??

    Hi there. I am trying to figure out how to count events by day of week. I have created a basic query that will convert my Date_of_Event into a week day but what I cant figure out is how to count occurences for any given day. For example, on a report I want to have everyday of the week listed and a total number of events that occurred on each day. Can anyone please help?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Do you care about week, month, year? At what level do you want the data to aggregate? Do you want a total for all Mondays, etc. regardless of week, month, year?

    If a date does not have any events then it won't list on report.

    Build a report and use Grouping & Sorting features with aggregate calcs in header/footer.
    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
    losingmymind is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    18
    I want to put in a date range and have it total the number of events that occurred on each day. I don't want to see each date, just "Sunday - 3" "Monday - 10" "Tuesday - 5" etc....the date range could be a whole year or just 2 weeks. I don't know what an aggregate calc is, sorry.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    An aggregate calc would be a sum or count or average of records. Like:

    SELECT Weekday([datefield]) AS WkDy, Count("*") FROM tablename GROUP BY Weekday([datefield]) WHERE [datefield] BETWEEN [enter start] AND [enter end];

    A GROUP BY (aggregate) query can be created in query design view by clicking the Totals button from the ribbon. Access Help has guidelines on using the query designer and building aggregate queries.
    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.

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

Similar Threads

  1. Week Number of Month not Year?
    By kwooten in forum Queries
    Replies: 6
    Last Post: 05-01-2013, 06:59 AM
  2. Start a report on week 40 of a week count
    By aspitalnick in forum Reports
    Replies: 8
    Last Post: 11-28-2012, 04:53 PM
  3. Week number - How do you reset?
    By BillG in forum Queries
    Replies: 11
    Last Post: 09-13-2012, 04:41 PM
  4. Count occurences of text in a query
    By funkygoorilla in forum Queries
    Replies: 5
    Last Post: 02-12-2012, 09:14 PM
  5. Week number wrong
    By Nikki17 in forum Queries
    Replies: 6
    Last Post: 03-18-2006, 10:01 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