Hi All,

I am having a stock report in my application. It has 4 Datagridview each one for OpeningStock, Purchase, Sales and ClosingStock. I am using vs2005 and access 2003 database. The report is based on from and to date basis. (i.e: if the user selects 2 dates, The opeining stock should be inclusive of opening stock+purchases-Sales made upto the startdate) likewise the purchase, sales and closing stock details.

I have 3 datatables one for the opening stock (Which is keyed in the beginning of the application), the another one contains purchasedetails upto the startdate and another one for salesdetails upto startdate.

What i want to show is datagrid1 for showing the opening balance
(i.e:InitialStock + Purchase - Sales) up to startdate,
datagrid2 is for showing the purchase (i.e: Purchases made from and to between dates)
datagrid3 is for showing the Sales (i.e: Sales made from and to between dates)
and datagrid4 is for showing the closingstock (i.e: InitialStock + Purchases - sales) upto the enddate.

Thanks in advance.
Any suggestion would be appreciated.

Recommended Answers

All 2 Replies

you can use three datatables for this , get required records for each datatable and then assign them to your grids.

Hi Aslam,

Thanks for your reply.
I know it requires 3 datatables and I am already written query for the 3 datatables.
What my issue is, How to combine these 3 datatables based on ID column and add and subtract the Qty column.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.