+ Reply to Thread
Results 1 to 5 of 5

Count the number of times two items appear in a table

  1. #1
    Registered User
    Join Date
    02-09-2010
    Location
    Saint Louis
    MS-Off Ver
    Excel 2013
    Posts
    3

    Count the number of times two items appear in a table

    I have a table in my brain tumor database (Access 2003) that records the various surgical technologies that are used in each surgical case (tblPituitarySurgTech in attached example). Some surgeries involve the use of a surgical microscope. Some use a endoscope. Some use a surgical navigation system called "Stealth". I can write a query that totals the use of each item (qryPituitarySurgTech in the attached example). That 's easy. What I can't figure out is how to count, for example, the number of cases in which both a microscope and an endscope are used. It seems like this should be a simple thing to do. I just can't figure it out.
    Attached Files Attached Files
    Last edited by ResearchRN; 02-11-2010 at 12:10 PM.

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Need query to count the number of times two items appear in a table

    Hi ResearchRN,

    Welcome to the forum!

    The result is a single cell:

    Please Login or Register  to view this content.

    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Registered User
    Join Date
    02-09-2010
    Location
    Saint Louis
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Need query to count the number of times two items appear in a table

    Quote Originally Posted by ConneXionLost View Post
    Hi ResearchRN,

    Welcome to the forum!

    The result is a single cell:

    Please Login or Register  to view this content.

    Cheers,
    Thanks for the welcome and your reply. However it's not quite what I'm looking for. The query appears to sum the number of times "endoscope" or " surgical microscope" appears in the table. What I need to know is how to find the number of cases in which both an endoscope and a microscope were used in the same case. For example, case number 36 used only an endoscope. Case number 37 used only a microscope. However case numbers 7, 114, and 178 used both. Just scanning the rest of the table it would appear that the total number of cases that used both would be 19 or so.

    Just to give you some background, nowadays these cases are done using an endoscope to gain access to the tumor and the microscope to remove it. In the past, they were done mostly by "eyeball". Then the microscope was added, then the endoscope. Now a lot of these cases are done using intra-operative MRI scanning. Lately they've been looking at 3D endoscopes in high def! The question we're trying to answer, among other things, is whether all these technologies really help and if so in what combination. It's the combination part I'm having trouble with.

    Thanks very much for your help.

  4. #4
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Count the number of times two items appear in a table

    Sorry, my fault for not reading carefully.

    Try this:

    Please Login or Register  to view this content.

    If you want to see the case numbers, then use:

    Please Login or Register  to view this content.

    Cheers

  5. #5
    Registered User
    Join Date
    02-09-2010
    Location
    Saint Louis
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Count the number of times two items appear in a table

    That's perfect! Thanks so much for taking the time to do this. I would never have gotten it on my own.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1