Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone

I am trying to make an application to merge access row values from one table to another
For example:
Table 1 Table 2
Product Name Quantity Bought > Product Name Quantity Bought
Shampoo 2 > Shampoo 3
Shampoo 1 > /\ /\

CD 2 > CD 4
CD 1 > /\ /\
CD 1 > /\ /\
(JUST AN EXAMPLE)
I am entering data into table 1 from a form in vb 6
I want it to be sorted and entered in table 2 as I shown to you in the example. I also want to update table 2 every time data is inserted in table 1.

Thank You
Posted
Updated 23-Jul-14 22:32pm
v2
Comments
PIEBALDconsult 20-Jul-14 11:08am    
Don't cross-post:
http://www.codeproject.com/Messages/4864854/Merging-Access-Row-Values.aspx
Member 10133042 20-Jul-14 11:11am    
I am really sorry
I thought that my question wasn't posted so i tried to do it again
[no name] 20-Jul-14 11:26am    
In addition to cross posting;
You do not store "sorted" data in a database. You sort it when you query it for display. The database does not care about sorting or order.
If you want to update Table 2 based on some input from Table 1 then write a trigger.
Member 10133042 20-Jul-14 23:51pm    
Thank you Sir
I solved the question by using the GROUP BY Clause
The Query I used:
"SELECT (Table).Productname, Sum((Table).Quantitybought) AS SumOfQuantityBought
FROM (Table)
GROUP BY (Table).Productname;"
(Based on my example)
(Table) = tablename you used

1 solution

SQL
"SELECT (Table).Productname, Sum((Table).Quantitybought) AS SumOfQuantityBought
FROM (Table)
GROUP BY (Table).Productname;"
(Based on my example)
(Table) = tablename you used
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900