Results 1 to 2 of 2

Thread: Query problem

  1. #1
    Join Date
    Sep 2003
    Location
    Virginia
    Posts
    1

    Unanswered: Query problem

    Hi - I wonder if what I am attempting can be done.

    I have created a database that stores course evaluation data. Users enter the course, date attended and answer a survey using a likert scale.

    I am trying create a query to get averages by a date range. I would like to combine all of the results retrieved for a specific course within the date range into one average. The problem is that the query that I created pulls results for each date and the averages are listed separately.

    See attached screen capture. You will see that I would like to combine the results from 09/05/2003 and 09/10/2003.

    SELECT Results.Course_Title, Avg(Results.Content) AS AvgOfContent, Avg(Results.Design_1) AS AvgOfDesign_1, Avg(Results.Design_2) AS AvgOfDesign_2, Avg(Results.Design_3) AS AvgOfDesign_3, Avg(Results.Instructor) AS AvgOfInstructor, Avg(Results.Perceived_Value_2) AS AvgOfPerceived_Value_2, Avg(Results.Perceived_Value_1) AS AvgOfPerceived_Value_1, Count(Results.ID) AS CountOfID, Results.datebox
    FROM Results
    GROUP BY Results.Course_Title, Results.datebox;


    Thanks for your help,
    Attached Thumbnails Attached Thumbnails query_results.gif  

  2. #2
    Join Date
    Aug 2003
    Location
    SW Ohio
    Posts
    198

    Re: Query problem

    Originally posted by speeddreamer
    Hi - I wonder if what I am attempting can be done.

    I am trying create a query to get averages by a date range. I would like to combine all of the results retrieved for a specific course within the date range into one average. The problem is that the query that I created pulls results for each date and the averages are listed separately.
    Try this:

    SELECT Results.Course_Title, Avg(Results.Content) AS AvgOfContent, Avg(Results.Design_1) AS AvgOfDesign_1, Avg(Results.Design_2) AS AvgOfDesign_2, Avg(Results.Design_3) AS AvgOfDesign_3, Avg(Results.Instructor) AS AvgOfInstructor, Avg(Results.Perceived_Value_2) AS AvgOfPerceived_Value_2, Avg(Results.Perceived_Value_1) AS AvgOfPerceived_Value_1, Count(Results.ID) AS CountOfID, Max(Results.datebox) as Begin_Date, Min(Results.datebox) as End_Date
    FROM Results
    GROUP BY Results.Course_Title;


    That more like it?
    Jim P.

    Supoorting Oracle, MSSQL7, Sybase 8, & Pervasive. Confusion Reigns

Posting Permissions

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