Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2004

    Unanswered: a few questions regarding LIKE (using LIKE with WHERE,etc...)

    can you use LIKE with a WHERE statement, and how?

    I am working on showing current shipments between similar zipcodes and when entering a new shipment I want to be able to show other shipments within a week that are going to similar zipcodes using the Left to look for the first 3 digits and do the LIKE on that. How can I use LEFT with the Like?

    and for what i believe to be the hardest one...

    Zip1 and Zip2, very similar to the last one, but I want to be able to check on shipments coming back. So I know it would have to be LIKE/LEFT on the Zip

    where Zip1 is like zip2 and zip2 is like zip1??

    I have never used the LIKE statement before and I am really extremely new using the WHERE statement.. please help thanks

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    like is a way of dong a partail match within a text field using wild card characters.

    for example
    select Name,Address from tblContacts where Postcode like "SK9*"

    would return all records where the postcode started with SK9
    like "???99506"
    would return all records where the last 5 digits of a 7 digit field matched 99506
    like "*FELT*" would, I think (I've never tried it) return any row whose postcode conatined FELT

    So you couldn't use where zipcode1 like zipcode2 - which would be the same as where zipcode1 = zipcode2

    So you would need to specify in the query what your like criteira are
    For your particular requirement you don't need to use the like criteria to find zip codes with the same first 3 digits you could return those digits in a query as left$(<zipcode,3>)
    To retrieve a subset then you do need to specify a limitation so the like clause comes into play if you have a current record you could request any records with similar zip code using
    where <zipcode> like <field containing the digits you want to match> & "*"

  3. #3
    Join Date
    Sep 2003
    Yes. Ex:

    ... WHERE (SomeField LIKE '%blah blah blah%') ...
    Back to Access ... ADO is not the way to go for speed ...

  4. #4
    Join Date
    Dec 2004
    can the where statement be used to call on a property

    if i am opening the same form and i want a combo.visible to be false in one instance but true in another, can this be done?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts