Results 1 to 4 of 4
  1. #1
    BudMan is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2014
    Location
    Stem, NC USA
    Posts
    20

    Question Finding duplicate permit numbers if condition met

    I work for a municipality that has a database that I am trying to collect information from.


    There are three fields that I am interested in working with.


    Permit_Date
    Permit_Number


    Permit_type


    Due to the way the original database was constructed, there are several permit types that have the same permit number. I am trying to construct a query that will allow me to find a specific permit type, and its associated number and any other permits with the same number. This is not just a matter of finding duplicates, but of finding duplicated permit numbers if a certain condition was met. Then if the condition was met, a “N/A” would be entered into the column. Otherwise, a formula that computes the age of the permit without the required permit type would be computed.

    I have tried writing various SQL statements, but without success. I don't know VBA, so that is not really an option.


    I know this probably sounds confusing, but I was hoping someone could assist me.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    dont need vba, just make a query
    in the query, say Qry1 , make a 'key' out of the 3 fields, and include other fields you want:

    MyKey: Permit_Date & Permit_Number & Permit_type

    now use the QUERY WIZARD to run FIND DUPLICATES query
    tell it to use Qry1
    and tell it the duplicate field is: MyKey

    it will show you the duplicate results.





  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    To find duplicate permits (number and type), I don't think you have to include date. however, if Permit_Date represents the effective period for the permit , then it should be included and follow ranman's advice.

  4. #4
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    A data set of 5 - 10 records and the expected results of a query would be nice/helpful.
    Quote Originally Posted by BudMan View Post
    .... matter of finding duplicates, but of finding duplicated permit numbers if a certain condition was met......
    What is the "certain condition"??


    Quote Originally Posted by BudMan View Post
    ...Then if the condition was met, a “N/A” would be entered into the column.....
    What column??



    Quote Originally Posted by BudMan View Post
    I am trying to construct a query that will allow me to find a specific permit type, and its associated number and any other permits with the same number.
    I can't tell if the permit type matters.......

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Finding missing numbers in a Sequential field
    By jjpuebla in forum Access
    Replies: 6
    Last Post: 08-27-2020, 08:39 AM
  2. Finding Duplicate Values
    By TimMoffy in forum Forms
    Replies: 4
    Last Post: 11-21-2012, 10:22 PM
  3. Replies: 7
    Last Post: 10-24-2012, 05:22 PM
  4. Replies: 2
    Last Post: 06-11-2011, 10:39 PM
  5. Replies: 1
    Last Post: 03-05-2010, 12:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums