Results 1 to 4 of 4
  1. #1
    desireemm1 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Aug 2009
    Posts
    50

    count value list in a query and report

    Hi everyone I have an issue and its in access, so I'm struggling with converting a select statement from SQL to Access 2010. Ugh I miss sql. anyone I have this statement that I am trying to run but I keep getting an error message: I have it s an image



    I'm trying to calculate Each value in my [Customer Type] combo box. like how many hang-ups or how many Unknown calls. When I did this in sql I did it in reporting services in a matrix, different database though. This is access and I am struggling with it can anyone please help I really gota get this done.

    the combo box values:
    GOV
    HANG-UPS
    APS
    UNKNOWN
    CLINIC


    AND I need to total on each one.

    GOV - 5
    HANG-UPS -7

    I have no idea how


    SELECT
    [Message Tracking].[User Retrieving],
    [Message Tracking].[Date Retrieved],
    [Message Tracking].[Date & Time Left],
    [Message Tracking].[User Returning],
    [Message Tracking].[Date Returned],
    [Message Tracking].[Caller],
    [Message Tracking].[Customer Type]


    FROM [Message Tracking]
    WHERE

    ( Message Tracking].[Date & Time Left]) Between [Begin_Date & Time Left] And [Ending_Date Returned)

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    It wouldn't work as you have written it in SQL either. You have typos in your WHERE clause (too many parens, missing a square bracket).
    It should be:
    Code:
    WHERE 
    ([Message Tracking].[Date & Time Left] Between [Begin_Date & Time Left] And [Ending_Date Returned])

  3. #3
    desireemm1 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Aug 2009
    Posts
    50
    Oh thank you Joe, my main problem is that I need to Add the Values in the combo box [Customer Type]

    does DCount(GOV, APS, HANG-UPS) AS TypeCount


    I have to have a total number of how many

    GOV
    APS
    HANG-UPS

    basically I have to show in a report how many times there was a hang-up, APS, GOV, etc...

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    How many different customer type values are there? Do you want a count for each or just one count all together?

    A CROSSTAB query could probably produce the individual count (like a matrix). However, building a report to run perpetually based on a CROSSTAB is not easy.

    Could use report Grouping & Sorting features with aggregate calc in group footer. Set a Grouping on the CustomerType field.

    Or an aggregate query could generate the single composite count.
    SELECT Count(*) AS CountGAH FROM tablename WHERE CustomerType IN("GOV", "APS", "HANG-UPS");

    Not sure how a combobox is involved in generating this output.
    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. Report/Query Count help
    By DOC in forum Access
    Replies: 6
    Last Post: 12-16-2013, 02:39 AM
  2. Replies: 7
    Last Post: 12-05-2012, 10:10 AM
  3. Count records based on report ,not in query
    By Abasalic4 in forum Reports
    Replies: 1
    Last Post: 04-13-2012, 12:46 PM
  4. Replies: 0
    Last Post: 07-13-2011, 08:32 AM
  5. Replies: 7
    Last Post: 07-22-2010, 01:14 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