List:General Discussion« Previous MessageNext Message »
From:mos Date:November 30 2008 4:23am
Subject:Re: How to find last price of items that were sold?
View as plain text  
At 04:14 PM 11/29/2008, you wrote:
>mos wrote:
>>The Details table has Product_Code: Char(20), Date_Sold: Date,  and 
>>Price_Sold: Double. The products are sold for different prices during the 
>>month and I need to retrieve the last price it was sold for.
>
>
>select product_code, price_sold,  max(date_sold)
>from details group by product_code;
>
>Regards
>Gautam

Gautam,
         I wish it were that easy. :-)
         Unfortunately the Price_Sold that is returned is not from the row 
with the max(date_sold). It can be any row from the table like the first 
row of the table.

Mike 

Thread
How to find last price of items that were sold?mos29 Nov
  • Re: How to find last price of items that were sold?Gautam Gopalakrishnan29 Nov
    • Re: How to find last price of items that were sold?mos30 Nov
  • Re: How to find last price of items that were sold?Peter Brawley30 Nov