Results 1 to 4 of 4
  1. #1
    New2Acess is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2016
    Posts
    2

    How to query first word contains? Or how to query first word begins with AND ends with?

    I have a file with about 1 million addresses. I am trying to filter for addresses that do not contain street numbers. I am easily able to group the streets that are words (ex. cherry street) by sorting the address column a-z but I am having a much harder time with numbered streets (ex. 13th street). I can filter these streets one by one using 'begins with' but that would take forever. I would like to be able to find a query that would let me filter for first word begins with a number (1-0) and ends with 'st' or 'th'. That would give me all of the address I am looking for at once.



    Any other suggestions are welcome

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Like "?*st * OR Like "?*th *"

    This might narrow it down, but you could add other combinations too.

    Include the space so that it doesn't appear in words.

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    If you are able to extract the street name (cherry, 1st, 22nd) from the address reliably you can place a criteria on the field testing the first and last character of the street name for isnumeric and not isnumeric respectively, just be aware that something like 12th and 12 th will not return the values you want. These types of strings are notoriously difficult to handle.

    If you are going to use aytee's method remember to include *nd

  4. #4
    New2Acess is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2016
    Posts
    2
    Thanks guys

    The solution I found was

    WHERE address LIKE '#ST*'; and so on. Each Number is represented by one #.

    So If I am looking for and 3 digit number ending in rd (ex. 123rd Street or 943rd Street) I would query WHERE address LIKE '###RD*';

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

Similar Threads

  1. query that will ignore a certain word
    By chr1stoper1 in forum Queries
    Replies: 2
    Last Post: 03-16-2015, 10:51 AM
  2. Replies: 6
    Last Post: 08-13-2014, 10:32 PM
  3. Replies: 8
    Last Post: 04-14-2013, 01:33 PM
  4. Call word object and import word fields
    By silverspr in forum Programming
    Replies: 3
    Last Post: 12-10-2012, 11:32 PM
  5. Access to Word - Multiple Word Templates?
    By alpinegroove in forum Programming
    Replies: 11
    Last Post: 06-12-2012, 04:42 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