Newest Record

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Propoflady

    #1

    Newest Record

    I want to do a database of horses and owners, owners change so what I
    want to know how to do is in the report pull the horse and current
    owner only,

    All help appreciated.

  • Tom van Stiphout

    #2
    Re: Newest Record

    On 31 Jan 2007 05:54:30 -0800, "Propoflady " <chanes@monticu le.com>
    wrote:

    I don't know your database design, but this is a possibly equivalent
    query in the Northwind sample database:
    SELECT Customers.Custo merID, Customers.Compa nyName, Orders.OrderID,
    Orders.OrderDat e
    FROM Customers INNER JOIN Orders ON Customers.Custo merID =
    Orders.Customer ID
    WHERE (((Orders.Order ID) In (select Max(OrderID) from Orders group by
    CustomerID)));

    In Northwind OrderIDs increment, so in the Where clause I'm getting
    the Max(OrderID) for each CustomerID.

    -Tom.

    >I want to do a database of horses and owners, owners change so what I
    >want to know how to do is in the report pull the horse and current
    >owner only,
    >
    >All help appreciated.

    Comment

    Working...