Determining the min date

  • Thread starter Thread starter jburris
  • Start date Start date
J

jburris

My database is for ordering courses. All courses have a different
start date. How can I determine what the minimum start date is for all
courses within an OrderID. In other words, when does a customers first
course begin?

Thanks
 
Jburris,

At a wild guess, you possibly have a Courses table, that includes a
StartDate field, and a CourseID field, and an Orders table, that
includes an OrderID field, and an OrderDetails table that includes an
OrderID field to relate it to the Orders table, and a CourseID field, to
relate it to the Courses table. Am I close?

If so, a query whose SQL view is something like this....
SELECT Orders.OrderID, Min([StartDate])
FROM Courses INNER JOIN (Orders INNER JOIN OrderDetails ON
Orders.OrderID = OrderDetails.OrderID) ON Courses.CourseID =
OrderDetails.CourseID
GROUP BY Orders.OrderID
 
Back
Top