Results 1 to 2 of 2
  1. #1
    pipelian is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    7

    Combine datatable rows based in common value

    Hi,
    i have been trying to combine data from 2 different sources, to make unique rows: here it is my situation
    Data in DGV already in dgv, Unbound:

    column1 | Qty
    "Sugar", 100
    "Salt", 100
    "Color", 200
    "Malto", 150

    Data in datatable:

    column1 | Qty
    "Sugar", 80
    "Salt", 60


    "Apio", 25
    "Lemon", 60
    "Color", 60

    So i want a control that matches the column1 in datatable against DGV.Column1, and if value matches only add second column value and if not, then make a new row in DGV.
    Final decided outcome:

    column1 | Qty|Qty2
    "Sugar"| 100 | 80
    "Salt" | 100 | 60
    "Color"| 200 | 60
    "Malto"| 150
    "Apio" | | 25
    Thanks In Advance

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    I suggest you research Normalization to get the proper table design.
    This site may be helpful http://phlonx.com/resources/nf3/

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Combine Two Rows - SQL Query
    By Somnath_IT2006 in forum Queries
    Replies: 1
    Last Post: 12-23-2011, 06:30 AM
  2. Query to find and COMBINE rows based on 2 fields
    By admessing in forum Queries
    Replies: 2
    Last Post: 12-13-2011, 12:59 PM
  3. Joining 2 Tables based on a Common Relation to Another
    By StudentTeacher in forum Programming
    Replies: 5
    Last Post: 07-26-2011, 07:23 AM
  4. combine rows
    By summerAIS in forum Queries
    Replies: 3
    Last Post: 07-31-2010, 10:13 PM
  5. Combine multiple rows into one cell
    By zarfx4 in forum Queries
    Replies: 8
    Last Post: 06-08-2009, 10:42 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums