Results 1 to 5 of 5
  1. #1
    koper is offline Novice
    Windows XP Access 2000
    Join Date
    Dec 2008
    Location
    Arizona
    Posts
    13

    Calculated Control With a Query that Counts

    I am interested in designing a query that will count the number of records that meet specific requirements. I want to be able to count the number of records where one or more fields meet certain requirements, such as where the age field is between 38 and 40 and the color field = blue. I am sure this is fairly trivial but I just can't see how to do it. I can see how to use a calculated control add numbers in a field together.



    Thanks!

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    The simplest counting query is:

    select count(*) from tableName where (age between 38 and 40) and color="blue"

  3. #3
    koper is offline Novice
    Windows XP Access 2000
    Join Date
    Dec 2008
    Location
    Arizona
    Posts
    13

    Thanks

    Thanks I will give it a try. What is the * in the "count(*) for? Is it just a place holder?

  4. #4
    koper is offline Novice
    Windows XP Access 2000
    Join Date
    Dec 2008
    Location
    Arizona
    Posts
    13
    Doesn't the expression have to begin with the = sign and then don't the field names need to have brackets?

  5. #5
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    "*" means everything.
    you can add "[]" if you like.
    between ... and ... don't need other sign.

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

Similar Threads

  1. Replies: 23
    Last Post: 06-30-2010, 02:05 PM
  2. Reporting counts in another query...maybe?
    By Geewaagh in forum Queries
    Replies: 7
    Last Post: 06-04-2010, 07:39 PM
  3. Calculated control help
    By cici in forum Forms
    Replies: 4
    Last Post: 05-16-2010, 12:04 AM
  4. Missing Counts that = 0 in query results
    By dandhjohn in forum Queries
    Replies: 1
    Last Post: 01-29-2010, 11:28 AM
  5. Control source and calculated values
    By meistersteff in forum Forms
    Replies: 0
    Last Post: 11-23-2007, 07:04 PM

Tags for this Thread

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