You need a group by having clause Select partnumber from orderdetails Group by partnumber having Max(OMActualShipDate) < '01/01/2005'
Ben -----Original Message----- From: Mark Weiss [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 17, 2006 7:04 PM To: [email protected] Subject: Witango-Talk: Stumped on Sql I have been trying for a couple of days to get this right and have made no headway. So I implore your assistance. I have a table of detail line items that are the line items for orders. This is joined to a header file that has all the dates, order dates, ship dates, etc. I am asking this, give me all the line items where the last date something was ordered was before 01/01/ 2005. So a part number 65000, if the last date it was ordered was 12/15/2004, it would show up in the list select partnumber from OrderDetail, OrderMaster where OMindexnumber = ODIndexnumber and Max(OMActualShipDate) < '01/01/2005' Anyway, if someone out there gets my drift, I would love to see another example. ]ppp Thanks Mark Weiss ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
