Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    629
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Grouping Query (2k)

    Hi, I'm trying to help my sister out with an access question dealing with grouping data.

    Attached is a spreadsheet (actual table data) that shows patient numbers in the A column follow by columns B-N (places they have visited such as the ER, Cardiac, etc). What she needs to do is group these patient numbers by similar visits - for example, the first 5 patients would be grouped together because they have the same visit info. she wants to then print out a report (otherwise she would have to do this line by line in excel). The data is in an access DB and i figure she can make a query to do this, but im not sure what it would need to contain. any ideas?
    <img src=/w3timages/blueline.gif width=33% height=2>
    <big>John</big>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Grouping Query (2k)

    What exactly does she mean by "the first five patients would be grouped together"?
    - If she wants only one record (line) in the report for those 5 patients, create a query that includes columns B through N but not the patient number from column A. Set the Unique Values property of the query to Yes, and use the query as record source for the report.
    - If she wants an individual record (line) for each of the 5 patients, specify each of the fields corresponding to columns B through N in the Sorting and Grouping window of the report, and specify ascending sort order. Patients with exactly the same pattern in columns B through N will be placed together.

  3. #3
    New Lounger
    Join Date
    Jun 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Grouping Query (2k)

    I am trying to determine what relationships exist. For example, how many pt no's in total had b & g? The query I would like to run though is not specifically to see how many have b & g, but to see a summary of all the relationships in the spreadsheet. The end result I am looking for is 10 pt no's had b&c, 5 pt no's had d&e, 15 pt no's had b&e&f, etc. Is there a way to accomplish this in access?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Grouping Query (2k)

    Welcome to Woody's Lounge!

    You can create a so-called totals query for this:
    - Create a new query based on the table.
    - Add the patient number field and the fields corresponding to B through N.
    - Select View | Totals to make the query into a totals query.
    - Set the Total option for the Patient Number field to Count.
    - Leave the Total option for the other fields as is (Group By).
    - Switch to datasheet view to see the result.
    - Save the query and use it as record source for your report.

  5. #5
    New Lounger
    Join Date
    Jun 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Grouping Query (2k)

    Thank you so much!! It gave me exactly what I needed.

Posting Permissions

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