2 Replies - 338 Views - Last Post: 12 December 2012 - 10:38 PM Rate Topic: -----

#1 vijaycare  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 05-April 12

add 2 datatable values based on id

Posted 12 December 2012 - 05:25 AM

Hi All,
I have 2 data table in my application and want to create a new table from those 2 tables.
The table1 contains data like
1 asd 500
2 bns 0
3 jvk 850
4 irs 250
5 lop 100
6 muo 350

The tabl2 contains data like
1 asd 1500
2 bns 1600
3 jvk 1550
4 irs 0
5 lop 1000
6 muo 3500

And I want to create a table from those 2 tables like:

ID DESC QTY

1 asd 2000
2 bns 1600
3 jvk 2400
4 irs 250
5 lop 1100
6 muo 3850

how can i achieve this. Any suggestion would be appreciated. Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: add 2 datatable values based on id

#2 Swapnilbarde007  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 33
  • Joined: 20-September 12

Re: add 2 datatable values based on id

Posted 12 December 2012 - 07:55 AM

Hi.
Would suggest you to post the structure of both the data tables. And what is common among those two, is there one to one relationship between those two tables.?
Was This Post Helpful? 0
  • +
  • -

#3 vijaycare  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 05-April 12

Re: add 2 datatable values based on id

Posted 12 December 2012 - 10:38 PM

Hi Swap,

Thanks for your immediate response.

The common item is ID.
The Structure of the datatable is ID, Desc, Qty, Unit, Date.
It is a datatable derived by a query from an access database.

I am really stuck with this one.
The datatables are all in the same structure
What I want is to add table1 with table2 and subtract it with table3.
Thats all. (i.e: table1 + table2 - table3) based on ID group by ID.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1