Respected sir,
I m developing windows application using vb.net with MS-Access as backend.
I want to generate sales report by selecting perticuler month
for that i m trying to develope sql query...
table : Stock
----------------------------------------------
id item size unit MRP
----------------------------------------------
1 abc 500 gm 120
2 xyz 500 gm 180
3 pqr 150 gm 60
4 lmn 50 gm 20
5 pqr 1 kg 500
----------------------------------------------
table : Sale
---------------------------------------------
sr Billno bill_Date itemID Qnty Total
---------------------------------------------
1 123 14/11/2013 1 2 240
2 123 14/11/2013 3 2 120
3 123 14/11/2013 4 3 60
4 124 20/02/2013 5 2 1000
5 124 20/02/2013 3 5 300
---------------------------------------------
I want to show required month's sales report like below
for example month=11
sr ItemName size unit MRP totalQnty TotalAmt
--------------------------------------------------
1. abc 500 gm 120 1 240
2. xyz 500 gm 180 0 0
3. pqr 150 gm 60 7 420
4. lmn 50 gm 20 3 60
5. pqr 1 kg 500 0 0
---------------------------------------------------
here i want to dislpay all the items present in stock and beside that how many items are sold in this perticular month,if that item is not sold in given month then it should be blank as i shown in above example sr. 5 pqr was sold in month no=2 and not in 11 so its showing zero..likewise...
what would be SQL query for this..
Please help me,
Thank you,..