Results 1 to 4 of 4
  1. #1
    cakin is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2012
    Location
    Lincoln, NE
    Posts
    2

    Complicated comparing of a table to its self


    I'm trying to make 84 queries then run them with a module, this is the easy part.

    The hard part is making the query, i need each query to compare a key set of events to a sub set of its self.

    So i need say key set 01-01 (column a) which has 400 events in column B to compare it to its sub set (all which will be 01-01.###### there will always be the decimal after the key part and also in column a) to make sure that none of the sub sets have any events in column B besides the ones in the key. i would like to simply flag all the ones that aren't in the key in column D.

    The biggest issue is this table changes every week (over 2 million entries) so i'd like to do something i can repeat every week quickly, like maybe just copy the table and use it to compare to the original.


    A B C D
    01-01 5656 -
    01-01 5657 -
    01-01 5658 -
    01-01 5659 -
    01-01.33 5656 -
    01-01.33 5657 -
    01-01.33 9999 - error
    01-01.33 7777 - error
    01-01.34 5659 -
    01-01.34 0000 - error
    01-01.35 5656 -
    01-01.35 8888 - error

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,600
    Will all data have 01-01 prefix - no 02-02 or 01-02?

    Try:
    SELECT Left([A],InStr([A],".")-1) AS Prefix, A, B FROM Table3
    WHERE A Like "##-##.*" AND B Not In(SELECT B FROM Table3 WHERE A Like "##-##");
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    cakin is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2012
    Location
    Lincoln, NE
    Posts
    2
    Quote Originally Posted by June7 View Post
    Will all data have 01-01 prefix - no 02-02 or 01-02?

    Try:
    SELECT Left([A],InStr([A],".")-1) AS Prefix, A, B FROM Table3
    WHERE A Like "##-##.*" AND B Not In(SELECT B FROM Table3 WHERE A Like "##-##");

    It will have 01-02, 02-01, 02-02, ect but they should be completely separate compares since they will have different event for sure and thats okay, just not if 02-02 was compared to 02-02.### and had a different event from 02-02.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,600
    Need representative dataset to test. Provide file - Excel or Access. Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Complicated
    By Ganymede in forum Queries
    Replies: 3
    Last Post: 01-22-2012, 06:25 PM
  2. Replies: 3
    Last Post: 12-21-2011, 10:49 AM
  3. Complicated form
    By secret in forum Access
    Replies: 14
    Last Post: 09-07-2011, 10:16 PM
  4. Complicated IIF?
    By Sweetnuff38 in forum Queries
    Replies: 1
    Last Post: 08-18-2011, 01:13 PM
  5. Help? Complicated Drop-Down
    By Pick9811 in forum Access
    Replies: 7
    Last Post: 06-19-2010, 01:35 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