#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    1
    Rep Power
    0

    Prevent Duplicates


    I need some help with a few things, but 1st is to prevent duplicate OwnerNames. I use MS Access and my query is:

    SELECT AAAA.Owner_Zip, AAAA.Owner_Name, AAAA.Owner_Address, AAAA.Owner_CityState, AAAA.Situs_Address, AAAA.Deed_Date, AAAA.Appraised_Value, AAAA.Living_Area, AAAA.Improvement_Value
    FROM AAAA
    WHERE Owner_Zip='76180'
    AND Owner_Address<>Situs_Address
    AND Owner_Address Not Like "PO Box*"
    AND Improvement_Value Not Like '0'
    AND Owner_Name Not Like "*Lp"
    AND Owner_Name Not Like "*Llc"
    AND Owner_Name Not Like "*City*"
    AND Owner_Name Not Like "*Corp"
    AND Owner_Name Not Like "*Bank*"
    AND Owner_Name Not Like "*Trust*"
    AND Owner_Name Not Like "*Inc"
    AND Owner_Name Not Like "*Ltd"
    AND Owner_Name Not Like "*Etal"
    AND Owner_Name Not Like "*Church*"
    AND Owner_Name Not Like "*Building*"
    AND Deed_Date Not Like "";

    My results sometimes include more than entry for Owner_names and I want to prevent this by only accepting the 1st as true and ignoring the following re-occurrences of that Owner Name. Any help will be greatly appreciated.

    J
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    334
    Rep Power
    246
    have you tried DISTINCT?
    Free MP3 Dance Music Downloads

    To err is human; To really balls things up you need Microsoft!
  4. #3
  5. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,029
    Rep Power
    4210
    Originally Posted by 1DMF
    have you tried DISTINCT?
    that's not really a solution, just a stopgap

    he's drawing duplicate owner names in a query which references only one table

    therefore, there are duplicate owners in the table
    r937.com | rudy.ca
    please visit Simply SQL and buy my book

IMN logo majestic logo threadwatch logo seochat tools logo