469,917 Members | 1,907 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,917 developers. It's quick & easy.

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
Feb 11 '08 #1
1 2240
ck9663
2,878 Expert 2GB
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
Feb 11 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Tobias Pfeiffer | last post: by
2 posts views Thread by Michele Moccia | last post: by
8 posts views Thread by Jack | last post: by
5 posts views Thread by Dinsdale | last post: by
1 post views Thread by mai | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.