Results 1 to 6 of 6

Thread: Group by query

  1. #1
    Join Date
    Apr 2007
    Posts
    3

    Group by query

    Hi;
    I have one table that contains patient visit, name, MRN, exam room. I would like to query the table and have it print for each date the names, MRN, and exam room for each date like:
    04-25-2007
    PATIENT ONE
    PATIENT TWO


    04-26-2007
    PATIENT THREE
    PATIENT FOUR

    Can someone give me a hand here?

    Thanks
    Riyad

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    On which rdbms? How does data look like in the table?

  3. #3
    Join Date
    Apr 2007
    Posts
    3
    I am using MS SQL 2000. The data consists of one table with the feilds Appt_dt, Name, location, ....

  4. #4
    Join Date
    Dec 2004
    Posts
    502
    It would be easier for us to help you if you gave us sample data from your table and the expected results based on that sample data. Otherwise, we'll only be making educated guesses as to the proper query that you need.

  5. #5
    Join Date
    Apr 2007
    Posts
    3
    I attached an excel spread sheet that contains a sample data and also the output (similar to the one below) needed.
    Thanks again;
    Riyad
    ---------------------------------------------
    7/11/2007
    John Do MCCRAE MD 15 Downtown
    John Fox WAGGONER MD 15 Satellite
    7/12/2007
    Jimmy doe KAUR MD 30 Downtown
    7/16/2007
    JANE WYE MOORE CNP 30 Satellite
    8/28/2007
    Jiffy Lube GARDZIOLA DO 30 Downtown
    6/14/2007
    Max Wax CH TRT RM 3 15 Downtown
    Attached Files Attached Files

  6. #6
    Join Date
    Dec 2004
    Posts
    502
    Seems like your question is more of a display issue rather than a data selection issue. Database queries are not suited for displaying the data in a nice report format. That should be left for the front-end application, or a reporting program.

Posting Permissions

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