Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Business Applications
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming graphics hard drive hardware hdmi internet laptop lcd malware memory monitor motherboard network operating system printer problem ram registry router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Solved: Microsoft Access Query Help

Reply  
Thread Tools
turnbuk's Avatar
Computer Specs
Junior Member with 15 posts.
 
Join Date: Apr 2007
Experience: Intermediate
28-Aug-2008, 04:21 PM #1
Solved: Microsoft Access Query Help
I have a database that includes repeat names but with different dollar value's attached to each name. For example:
| Joe Smith | $10,925 |
| Joe Smith | $10,327 |
| Joe Smith | $10,725 |
I want to create a query that will find a repeat name, identify the record with the highest $ and then delete the rest. Allowing me to have a quesry that shows no repeat names but keeps the record with the highest $.

Any suggestions?
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 14,665 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
28-Aug-2008, 04:34 PM #2
Take a copy of the Table using the "Structure Only".
Make a Query of your original Table using Totals and group by the Name and set the Dollar value to Max.
Run the Query and it should give you the record you need.
Change the Query type to an Append Query and append the data to the new Table, save and run it.
If it allows you to run it, it will do what want.
__________________
OBP
I do not give up easily
turnbuk's Avatar
Computer Specs
Junior Member with 15 posts.
 
Join Date: Apr 2007
Experience: Intermediate
28-Aug-2008, 05:53 PM #3
i'm going to add a couple more fields.

____Facility______Name_____SSN______Amount_
| 3722100100 | Joe Smith | xxxxxxxxx | 25,239.97 |
| 3720100100 | Joe Smith | xxxxxxxxx | 25,239.97 |
| 3720100101 | Joe Smith | xxxxxxxxx | 25,239.97 |
| 3722140900 | Joe Smith | xxxxxxxxx | 25,239.97 |
| 3720100100 | Joe Smith | xxxxxxxxx | 23,863.34 |
| 3722100100 | Joe Smith | xxxxxxxxx | 23,863.34 |

How can i create a query to so that the results is:

____Facility______Name_____SSN______Amount_
| 3722100100 | Joe Smith | xxxxxxxxx | 25,239.97 |

Its very important that i keep all the fields. i've got a database with over 7000 records and this is a frequent occurence. I try to delete repeat occurences but because the facility numbers are different it doesn't consider them repeats. Again, i need the highest $ and facility number that goes with that record plus name and SSN. Delete the rest. Any suggestions?
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 14,665 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
29-Aug-2008, 08:02 AM #4
It is still the same advice as in post #2, except have the facility Number set to max as well.
Once you have created the new table you should arrange to only "Update the data" rather than appending new data to the table.

Can you post a copy of the database with just a few dummy records in it so that I can work on it and demostrate the principle?
__________________
OBP
I do not give up easily
Reply

Tags
access, query

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:06 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.