Home Forums SQL Server 7,2000 Globalization Products with Last Purchase Date and Last Purchase ID RE: Products with Last Purchase Date and Last Purchase ID

  • Purchase Table includes the following fields.

    PurchaseID

    PurchaseDate

    Remark

    Purchase Deatails Table includes the following fields.

    PurchaseDetailsID

    PurchaseID

    ProductID

    BatchNo

    Quantity

    Price

    Amount

    here sample data

    PurchaseID PurchaseDate

    100 12/1/2009

    101 12/20/2009

    102 12/30/2009

    PurchaseDetailsID PurchaseID ProductID Quantity BatchNo

    200 100 20 100 A10000

    201 101 20 120 B10001

    202 102 20 50 D01111

    I would like to get product with Last Purchase Date and Last Purchase ID as below.

    PurchaseID Date Product Qty BatchNo

    102 12/30/2009 20 50 D01111