Highest date in a column

  • Hi,

    I want to identified which was the last date register for a product. I want to determine which is the last date posted for product.

    For example:

    A store bought 2 items of product A on 12/5/2004, 5 items of the same product on 12/10/2004 and 3 items of the same product on 12/20/2004.

    How can I extract the last date of purchase for Product A.

     

    Thanks for your help.

  • Select max(DatePurchase) from dbo.OrdersItems where Item_id = ???

    or the last purchase date for each item :

    Select Item_id, max(DatePurchase) from dbo.OrdersItems where Group by Item_id

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply