FIFO Stock Taking...in Sql 2000

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gulvaiz
    New Member
    • Feb 2008
    • 2

    FIFO Stock Taking...in Sql 2000

    Dear Members,
    Hi I'm Shahzad form PAKISTAN.
    I want stock in FIFO system.
    let suppose i have two tables, pur, and sale,
    now i want results like that

    Date Transction Description Qty Rate Total

    01-Jan-2008 Pur HDD-80GB 2 3300 6600

    02-Jan-2008 Pur HDD-80GB 2 3350 6700

    03-Jan-2008 Sale HDD-80GB 3 4000 8000

    Now sale must be deducted from 1st pur qty (2) and 2nd pur qty (1).
    and show the remaining qty 1. with rate 3350.
    How i will be handled in qurey.
    Waiting for your soon postive reply
    Regards
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Originally posted by gulvaiz
    Dear Members,
    Hi I'm Shahzad form PAKISTAN.
    I want stock in FIFO system.
    let suppose i have two tables, pur, and sale,
    now i want results like that

    Date Transction Description Qty Rate Total

    01-Jan-2008 Pur HDD-80GB 2 3300 6600

    02-Jan-2008 Pur HDD-80GB 2 3350 6700

    03-Jan-2008 Sale HDD-80GB 3 4000 8000

    Now sale must be deducted from 1st pur qty (2) and 2nd pur qty (1).
    and show the remaining qty 1. with rate 3350.
    How i will be handled in qurey.
    Waiting for your soon postive reply
    Regards

    based on the sample data, what's your desired output:?

    -- ck

    Comment

    Working...