HeelNGville
Registered User.
- Local time
- Today, 08:21
- Joined
- Apr 13, 2004
- Messages
- 71
Can someone offer guidance here? I have a table that stores liquidated inventory records. I want to design a make table query to dump selected records into a new table. Some of the more important fields in the table are as follows:
Vendor Location Units Type
9998 A004B106 2 Home Decor
A278 A004B106 5 Home Improvement
AA16 A004B106 1 Cleaning
AH55 A004B106 3 Personal Care
X910 A004B106 2 Personal Care
N004 A004B106 2 Rugs
A278 A004B106 7 Home Improvement
Ideally, I want the query to only retrieve 1 record for each location. For the listing above, I would like the data to be displayed as such:
Vendor Location Units Type
Mixed A004B106 22 Home Improvement
Basically, If the vendor count a 1 location is >1 I want to change the vendor to "Mixed", sum all units assigned to the location and populate the "Type" field with the description containing the greatest unit count. If I use the "First" or "Last" function in the "Type" field, the returned result is based on the alphabet positioning, so that option would not work for me. Any guidance would be greatly appreciated!
Regards,
Rick
Vendor Location Units Type
9998 A004B106 2 Home Decor
A278 A004B106 5 Home Improvement
AA16 A004B106 1 Cleaning
AH55 A004B106 3 Personal Care
X910 A004B106 2 Personal Care
N004 A004B106 2 Rugs
A278 A004B106 7 Home Improvement
Ideally, I want the query to only retrieve 1 record for each location. For the listing above, I would like the data to be displayed as such:
Vendor Location Units Type
Mixed A004B106 22 Home Improvement
Basically, If the vendor count a 1 location is >1 I want to change the vendor to "Mixed", sum all units assigned to the location and populate the "Type" field with the description containing the greatest unit count. If I use the "First" or "Last" function in the "Type" field, the returned result is based on the alphabet positioning, so that option would not work for me. Any guidance would be greatly appreciated!
Regards,
Rick