Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to summ similar items 1

Status
Not open for further replies.

arman28

Technical User
Feb 23, 2010
25
US
This is what I am trying to do..

Import Date | Shoe Style | Shoe Color | Quantity |
------------|------------|------------|----------|
11/20/2003 | A2003B | Red | 100 |
11/19/2003 | A2003B | Red | 20 |
11/20/2003 | A2005B | White | 80 |
11/20/2003 | A2003B | Red | 100 |
11/20/2003 | A2003B | Green | 100 |

AND

Export Date | Shoe Style | Shoe Color | Quantity |
------------|------------|------------|----------|
11/20/2004 | A2003B | Red | 100 |
11/19/2004 | A2003B | Red | 100 |
11/20/2005 | A2005B | White | 80 |
11/20/2005 | A2005B | White | 100 |
11/20/2004 | A2003B | Blue | 100 |

This is what I need, the matching color and style with their quantities added in one table;

Import Date |Shoe Style| Shoe Color | Quantity |
------------|----------|------------|-----------
11/20/2003 | A2003B | Red | 220 |
11/20/2003 | A2005B | White | 80 |

continue with the below table..

Export Date |Shoe Style| Shoe Color | Quantity |
------------|----------|------------|-----------
11/20/2004 | A2003B | Red | 200 |
11/20/2005 | A2005B | White | 180 |
 
A staring point:
SELECT MAX([Import Date]) AS LastDate, [Shoe Style], [Shoe Color], SUM(Quantity) AS Total
FROM yourTable
GROUP BY [Shoe Style], [Shoe Color]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
You have no idea how long I struggled with this. This is what I wanted to get so far out of what I am doing.
Thank you very much.
My Regards;
Arman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top