Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query - Not quite able to do what I want...

Status
Not open for further replies.

ellford

Programmer
Nov 19, 2004
13
US
Hey folks, I need your help here yet again. I have an educational database of courses that I'm trying to get the following results from a query:

Course Name Session Avalability
Session Time Location
Blah June 9/05 8am Dallas
June 10/05 9am Washington
July 4/05 9am Miami

Blah Blah Aug 4/05 9am Victoria
Aug 10/05 7am Vancouver
Sep 1/05 9am Portland

Now the query I have is as follows:

SELECT DISTINCT Course_Name, Course_Date, Course_Time, Course_City
FROM Tbl_Courses
WHERE (((Tbl_Courses.Course_Date)>=Date()));

This is providing me all the courses that are greater or equal to today's date, but I'd like to be able to group them by the course name, as in the example above.

Is this even possible?
 
SELECT DISTINCT Course_Name, Course_Date, Course_Time, Course_City
FROM Tbl_Courses
WHERE (((Tbl_Courses.Course_Date)>=Date()))
ORDER BY Course_Name, Course_Date, Course_Time;

Now if you want the "blanks" under each course until the next course, that's a report grouping function. I don't think you can do that in just the SQL.

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
 
GROUP BY" is an SQL term meaning "... show only one instance of the field (or combination of fields) in the GROUP BY clause ..." That doesn't appear to be what you mean from your example.

You could simply ORDER BY 1, 2 to sort them by Course Name and by Session within each course.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top