I have Two Tables
Tabel 1 is
Purchase
prodcode
billno
billdate
quantity
Tabel 2 is
Stock
prodcode
quantity
I m looking for the number of rows from purchase table which matches stock table with prodcode and quantity selected from purchases is less than or equal to quantity from stock table
e.g.
purchase
code billno billdate qty
prod1 1001 01/01/2007 120
prod1 1002 10/2/2007 100
prod2 1003 11/3/2007 200
prod2 1004 12/4/2007 100
stock
code quantity
prod1 130
prod2 200
then the result should be
prod1 1001 01/01/2007 120
prod1 1002 10/2/2007 10
prod2 1003 11/3/2007 200
Thanks and Regds
Narendra
Tabel 1 is
Purchase
prodcode
billno
billdate
quantity
Tabel 2 is
Stock
prodcode
quantity
I m looking for the number of rows from purchase table which matches stock table with prodcode and quantity selected from purchases is less than or equal to quantity from stock table
e.g.
purchase
code billno billdate qty
prod1 1001 01/01/2007 120
prod1 1002 10/2/2007 100
prod2 1003 11/3/2007 200
prod2 1004 12/4/2007 100
stock
code quantity
prod1 130
prod2 200
then the result should be
prod1 1001 01/01/2007 120
prod1 1002 10/2/2007 10
prod2 1003 11/3/2007 200
Thanks and Regds
Narendra
Comment