Results 1 to 5 of 5
  1. #1
    lizzywu is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    41

    To count the number of lookup options

    Hi there,

    I tried to use a query to count the number of different lookup options (call_outcome) for the customers in my database. There are seven lookup options. If I only want to get the number of call outcomes which must be among the lookup option 1, 2, 3, is it possible to get exactly one number for each customer?



    I attach my database here. The query I did gives me more than one number for each cumtomer. But I do need only one number that tells me the total number of calls made.

    Thank you very much.
    Attached Files Attached Files
    Last edited by lizzywu; 02-23-2012 at 12:09 PM.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848

  3. #3
    lizzywu is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    41
    Orange, I attached the mdb version. Thank you.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Try this

    SELECT t_customer.customer_id
    , Count(t_lookup_outcome.outcome_id) AS cnt
    FROM
    t_lookup_outcome INNER JOIN t_customer ON
    t_lookup_outcome.outcome_id = t_customer.call_outcome
    WHERE (((t_lookup_outcome.outcome_id) In (1,2,3)))
    GROUP BY t_customer.customer_id;
    Last edited by orange; 02-23-2012 at 05:08 PM. Reason: Change to SQL

  5. #5
    lizzywu is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    41
    Yes, exactly what I want. Thank you very much, Orange.

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

Similar Threads

  1. Count number of days
    By ramindya in forum Queries
    Replies: 1
    Last Post: 02-22-2012, 04:47 PM
  2. Replies: 6
    Last Post: 07-25-2011, 01:54 PM
  3. Count Text as Number
    By AccessFreak in forum Forms
    Replies: 1
    Last Post: 01-04-2011, 12:49 PM
  4. Don't show lookup list options in report
    By dara in forum Reports
    Replies: 1
    Last Post: 02-17-2010, 10:26 PM
  5. Part Number Lookup
    By jacobbiljo in forum Queries
    Replies: 1
    Last Post: 11-12-2009, 09:22 AM

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