Results 1 to 5 of 5
  1. #1
    acces is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Posts
    10

    Query which filters the database

    Hello!



    I would like to make an query for my database that filters and removes entires which contains one of the words from a list of words. What is the best way to do this?

    Should i make a second database with the words i want to remove and link it with the main database someway? In that case what is the best way to do this?

    Or should i make an big criteria that contains all these words?

    The database has about 200k entries and there is about 2k different words i want to filter the database from.

    Thank you
    Br

  2. #2
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    You could do a delete query and select the field containing the word(s) you want to delete as the criterion. It would take a long time.

    I do not know if you can split it with specific criteria like that...

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    A second table, (not database) that has the keywords.
    Yes with this table of keywords you can run a query to delete * from table where [word] IN table...

    A delete query MUST use the IN clause. You cannot join it to the keyword table.
    (create a FIND DUPLICATES query using the query wizard, then design it, this will show you how to use the IN clause. Its a query IN a query)

  4. #4
    acces is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Posts
    10
    Thank you for your reply!


    I am sorry if i was a bit unclear I mean that i have a table that i need to filter from serchwords in another table.


    Is it possible to make a SQL Query something like these


    Select Field1
    From Table1
    Where (Field does not contain a word from the Field2 int table2)


    I know you can make SQL Queries that exclude entries that are exact matches from another table. But is it possible to exclude on search words from another table? Example: If i have an entry "mike" in Field customer in table1 and i have the word "%ik%" in the searchword field in table 2. Can i then make a sql code that excludes mike because mike has "ik" in it?


    If this is not doable in SQL what language should i choose in Access? VB, Dynamic SQL or the criteria functions?

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    If Table2 has the actual string 'ik' as value in Field2 then a query can do pattern match, if not, no and need VBA - very complicated VBA.

    If Field1 has 'Mike' and Field2 has bike, trike, Mike - how will query know to match on '*ik*'? And if it could, it would also match to bike and trike.
    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. Query with 2 filters
    By alex2013 in forum Queries
    Replies: 2
    Last Post: 10-09-2013, 04:07 PM
  2. Different filters for same field in one query
    By pmatush in forum Queries
    Replies: 3
    Last Post: 04-01-2013, 12:10 PM
  3. Query filters slower, if left open
    By Frenotx in forum Queries
    Replies: 5
    Last Post: 01-25-2012, 03:25 PM
  4. Replies: 1
    Last Post: 09-26-2011, 03:12 PM
  5. Query Filters
    By ellixer in forum Queries
    Replies: 2
    Last Post: 06-27-2011, 08:26 AM

Tags for this Thread

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