PDA

View Full Version : Consolidate fields on query


ChaseWashington
May 4, 2007, 03:41 PM
OK I know there is an easy way to do this and for the life of my I cannot figure it out...

When designing a query, how can you make it where a certain field only lists once.

For example if you are trying to pull names from a customer list for people that have spent more than $100. Some people may have spent more than $100 more than once... how can you get the query to show that person only one time on the query.

Thank you so much for your time and help,
Chase W.

jstrike
May 31, 2007, 09:00 AM
Use distinct.
Select distinct customername from customerlist where totalcost>100.00

Distinct applies to the whole select statement so if you have a John Smith in Chicago and a John Smith in Milwaukee you will only get one unless you add other fields:
Select distinct customername, customercity from customerlist where totalcost>100.00
That would return both John Smith's.

HTH.