Results 1 to 2 of 2

Thread: [T-SQL] Help with LastBuy price of an item

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2006
    Location
    Surabaya, Indonesia
    Posts
    163

    [T-SQL] Help with LastBuy price of an item

    I have these tables:

    Item:
    Name | SellPrice
    ---------------------
    A | 100
    B | 200
    C | 300

    And a table of buyitem details
    ItemName | BuyPrice | Date
    ------------------------------
    A | 50 | 1-1-2011
    A | 75 | 1-2-2011
    B | 150 | 1-1-2011
    B | 125 | 1-5-2011
    C | 270 | 1-1-2011
    C | 260 | 2-8-2011

    How can I know each item last buy price? So I can make a table like this:
    Name | SellPrice | Last Buy Price
    --------------------------------
    A | 100 | 75
    B | 200 | 125
    C | 300 | 260

    I don't have any idea on how to make the queries for this result. I hope someone can help me..

    Thanks before..
    Check my Blog at VB Corner,Component Crafts

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Sep 2006
    Location
    Surabaya, Indonesia
    Posts
    163

    Re: [T-SQL] Help with LastBuy price of an item

    Still stuck at this problem. Is there anyone who can give me a solution?
    Check my Blog at VB Corner,Component Crafts

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width