Distinct records

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mrum73
    New Member
    • Aug 2007
    • 1

    Distinct records

    I have a table with the fields Market and FName.
    is there a way query for the FNames that Show up in more than one Market. And then display the Markets and FNames?

    Thanks
  • mlcampeau
    Recognized Expert Contributor
    • Jul 2007
    • 296

    #2
    Originally posted by mrum73
    I have a table with the fields Market and FName.
    is there a way query for the FNames that Show up in more than one Market. And then display the Markets and FNames?

    Thanks
    Not sure of a way to do it with one query, but if you make one query such as:
    [CODE=sql]SELECT FName, Count(FName) AS CountOfFName
    FROM TableName
    GROUP BY FName;[/CODE]

    Create a second query such as:
    [CODE=sql]SELECT TableName.FName , TableName.Marke t
    FROM QueryName RIGHT JOIN TableName ON QueryName.FName = TableName.FName
    GROUP BY TableName.FName , TableName.Marke t, QueryName.Count OfFName
    HAVING (((QueryName.Co untOfFName)>1)) ;[/CODE]

    This should give you your desired results. Just change your table/query names to the names you have used.

    Comment

    Working...