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!

Best way to combine records? 3

Status
Not open for further replies.

perrymans

IS-IT--Management
Nov 27, 2001
1,340
US
I have:

Code:
   A     |    B   |   C   |   D    |    E     | F
---------|--------|-------|--------|----------|-----
V0002420 | DG0010 | Desc. |        |          |
V0002420 | DG0010 |       | Status |          |
V0002420 | DG0010 |       |        | Severity |
V0002420 | DG0010 |       |        |          | Cat.

How can I make it:

Code:
   A     |    B   |   C   |   D    |    E     | F
---------|--------|-------|--------|----------|-----
V0002420 | DG0010 | Desc. | Status | Severity | Cat.

I am looking for the best and easiest way. There are multiple sets like this and it is the end of an automated routine anway, so it will be fired from VBA.

Thanks. Sean.
 
Code:
Select A, B, MAX(C) As MC, MAX(D) As MD, 
       MAX(E) As ME, MAX(F) As MF INTO myNewTable

From myTable

GROUP BY A, B
 
I think I will go with the easier SQL version by Golom.

Thank you both! Sean.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top