Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Auto is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2013
    Posts
    60
    Quote Originally Posted by orange View Post
    Why are some fields NULL if they are required for the Primary Key?
    lets make it simple.
    i have 3 fields, and they have different inputs,
    field 1 is for images, and some of them dont have, so it can contain null value.
    field 2 is an ITEM number, my older files didnt had this option, so when i import this records it contains nulls.


    field 3 is the FilePath from an excel file, it usually contains the phone number from customer, but some times it dont have, so it will be null.

    now, if i want a clean database with no dups, then i must set the primary key for all 3 fields, because a dup is only considered if all 3 fileds match with another record.

    hope that explains it.

  2. #17
    Auto is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2013
    Posts
    60
    Ok, i went with the Select Distinct query and pushed it into a new table and deleted the old one.
    i am not sure why the Delete function is freezing,
    is it because it cant handle so many records?
    or something to do with the query? or the table?

  3. #18
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Did you make a backup, or have one?
    What exactly do you mean by the delete function is freezing? Did you get an error message?
    Often advisable to do a SELECT query to ensure you're getting the right records, then do a delete.

  4. #19
    Auto is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2013
    Posts
    60
    hi, all again
    so after two weeks, and i am back with the same situation again, i need to analyze the data again and remove all duplicates, last time i made a Select Distinct query and pushed it in to a new table, then i deleted the old one, but i need to do it frequently, so deleting tables and creating is not my best solution.

    now i want to stick with the DELETE query which makes the most sense to me, and now i am having only 37,852 records in the table and it still hangs the delete query, so please anyone that can help me get it work i will appreciate.

    so when i try this
    Select MAX(ID)FROM Orders
    GROUP BY Orders.Image, Orders.ITEM, Orders.FilePath
    its returning all results like a charm,

    now when i do this
    Select *FROM Orders
    WHERE Orders.ID NOT IN
    (Select MAX(ID)
    FROM Orders
    GROUP BY Orders.Image, Orders.ITEM, Orders.FilePath
    );
    it hangs down, brings only 255 results, and it freeze then it brings another 250 results and freeze again and so on.
    now how can i avoid that? any better idea?

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 05-03-2011, 01:36 PM
  2. Duplicate query with complex delete function
    By rushforth in forum Queries
    Replies: 9
    Last Post: 08-20-2010, 01:21 AM
  3. Replies: 1
    Last Post: 05-21-2010, 02:22 PM
  4. Delete record if duplicate
    By rubintheyid in forum Access
    Replies: 8
    Last Post: 03-30-2010, 11:33 AM
  5. Delete duplicate records
    By Zukster in forum Queries
    Replies: 1
    Last Post: 08-26-2009, 03:14 AM

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