Results 1 to 2 of 2
  1. #1
    aparnawangu is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jul 2015
    Posts
    40

    Query calculating total weekly enquiry nos

    Hi Team,
    I have a table called Enquiry_Form table and i want to write a query for calculating total no of enquiries in a week.
    The columns in the enquiry table are
    Enquiry_Form_No,Enquiry_Date,Centre_Name.
    Pls help me in creating this query as i am very new to Access.


    Regards
    Aparna

  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,825
    What do you consider a week - Sun thru Sat? What about the weeks that cross months and years?

    DatePart("ww", Enquiry_Date) will return the week number of year.

    Also need the year.

    An aggregate (GROUP BY) Totals query can be used to calculate the total for each week by grouping on the calculated year and week.

    SELECT Year(Enquiry_Date) & DatePart("ww", Enquiry_Date) AS YrWk, Count(*) AS CountEnquiry FROM Enquiry_Form GROUP BY Year(Enquiry_Date) & DatePart("ww", Enquiry_Date);

    With this approach, the first and last weeks of the year will not always have 7 days.
    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. calculating total job costs.
    By Homegrownandy in forum Access
    Replies: 9
    Last Post: 11-05-2015, 02:10 AM
  2. Replies: 1
    Last Post: 10-18-2012, 12:01 PM
  3. Weekly Total
    By coffeyja in forum Access
    Replies: 3
    Last Post: 01-13-2012, 12:30 AM
  4. weekly total
    By nkuebelbeck in forum Queries
    Replies: 2
    Last Post: 03-24-2010, 02:59 PM
  5. Need help with calculating Time total
    By Monoceros in forum Reports
    Replies: 1
    Last Post: 04-20-2009, 12:44 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