Results 1 to 2 of 2
  1. #1
    hognabbt is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2010
    Posts
    1

    Query: How many times does a value exist?

    Hello,

    I have a calculation issue that I have not figured out how to do. Basically: "In how many records does a specific value appear in another table"? Here is an example how I would use it:

    Table: tblPersons
    Fields: Name (Primary key), BirthDate, WorkerID,

    John, 20.02.1950, 12345
    Fred, 21.02.1951, 12346
    Mike, 23.02.1952, 12347
    Larry, 24.02.1955, 12348
    Paul, 24.02.1944, 12349

    Table: tblPlaces
    Fields: Place (Primary key), HostName



    Warehouse, John
    Factory, John
    Factory2, Fred
    Cafe, Mike
    Shop, Paul

    I'd need to create a counting field to a query and the query would look like this:

    Query
    Fields: tblPersons.[Name], "HostingTotallyPlaces"

    John, 2
    Fred, 1
    Mike, 1
    Larry, 0
    Paul, 1

    Any ideas how to solve this? I tried to work with SQL Count command but it didn't solve the issue completely. Thanks in advance!

  2. #2
    MAF4Fam6's Avatar
    MAF4Fam6 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Location
    Fruit Heights, Utah USA
    Posts
    140

    Post

    You can achieve this using a simple select query.
    Please refer to the following image:
    Attachment 514
    Thanks.

    -RC

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

Similar Threads

  1. Replies: 3
    Last Post: 11-22-2009, 07:46 AM
  2. Replies: 0
    Last Post: 10-19-2009, 11:11 AM
  3. Top 3 times for each distance
    By CraigBFG in forum Queries
    Replies: 0
    Last Post: 06-24-2009, 09:19 AM
  4. Stoping Times disappearing
    By AJH1984 in forum Access
    Replies: 10
    Last Post: 06-19-2009, 05:46 AM
  5. Replies: 1
    Last Post: 08-22-2006, 04:27 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