Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    138

    Unanswered: Calculate the # of records of a specific type in a field

    I have a database that has a field [Lock]

    In the query/table, the field has a drop down box that shows different values, i.e. A1, B1, B2, B3, etc.

    How do I (in a report) calculate the number of values for a specific value, i.e. I want to know how many A1's there are, etc, even if all values are showing in the report.

    Thanks!

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    If you just want A1 (ie 1 particular value), use a DCount. If you want a summary of all of them, use a totals query in a subreport.
    Paul

  3. #3
    Join Date
    Dec 2003
    Posts
    138
    Can you explain a little more about the Totals Query in a subreport? I've never tried this before. I was looking at DCount, but I'm not sure that's what I need.

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    A DCount would be fine for 1 or 2, but too many will slow down the report, plus they're not dynamic. Try this query:

    SELECT Lock, Count(*) AS HowMany
    FROM TableName
    GROUP BY Lock
    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •